public SimpleDatumRule(double salience, Relations.Relation kind, Memory memory, ConceptTranslator produceTranslator, POSTagger tagger, GrammarParser parser) : base(ArgumentMode.ManyArguments, salience, 3 * 4, 10, tagger, parser) { this.kind = kind; this.memory = memory; this.produceTranslator = produceTranslator; this.tagger = tagger; }
public static void Know(Memory memory, Context context, Relations.Relation kind, IParsedPhrase phrase, double weight, ConceptTranslator produceTranslator) { Concept concept = produceTranslator.GetConcept(phrase); Datum datum = new Datum(null, kind, concept, weight); context.LookupAndAdd <List <Datum> >("$knowPartials", new List <Datum>()).Add(datum); }
public static void LoadVariables(Context context, double salience, Memory memory, ConceptTranslator produceTranslator, Verbs verbs, Nouns nouns, PluginEnvironment plugenv) { POSTagger tagger = new POSTagger(plugenv); GrammarParser parser = new GrammarParser(plugenv); context.Map.Add("@know", new KnowRule(salience, memory, tagger, parser)); context.Map.Add("@event", new EventRule(salience, memory, tagger, parser)); context.Map.Add("@Subject", new SimpleDatumRule(salience, Relations.Relation.Subject, memory, produceTranslator, tagger, parser)); context.Map.Add("@Object", new SimpleDatumRule(salience, Relations.Relation.Object, memory, produceTranslator, tagger, parser)); context.Map.Add("@Indirect", new SimpleDatumRule(salience, Relations.Relation.Indirect, memory, produceTranslator, tagger, parser)); context.Map.Add("@IsA", new SimpleDatumRule(salience, Relations.Relation.IsA, memory, produceTranslator, tagger, parser)); context.Map.Add("@HasProperty", new SimpleDatumRule(salience, Relations.Relation.HasProperty, memory, produceTranslator, tagger, parser)); context.Map.Add("@Means", new SimpleDatumRule(salience, Relations.Relation.Means, memory, produceTranslator, tagger, parser)); context.Map.Add("@Condition", new SimpleDatumRule(salience, Relations.Relation.Condition, memory, produceTranslator, tagger, parser)); context.Map.Add("@MotivatedBy", new SimpleDatumRule(salience, Relations.Relation.MotivatedByGoal, memory, produceTranslator, tagger, parser)); context.Map.Add("@Exists", new SimpleDatumRule(salience, Relations.Relation.Exists, memory, produceTranslator, tagger, parser)); context.Map.Add("@UsedFor", new SimpleDatumRule(salience, Relations.Relation.UsedFor, memory, produceTranslator, tagger, parser)); context.Map.Add("@AtTime", new AtTimeRule(salience, memory, tagger, parser)); context.Map.Add("@InLocation", new InLocationRule(salience, memory, verbs, tagger, parser)); //context.Map.Add("@ActiveObjects", new AllObjectsRule(salience, true, memory, produceTranslator, tagger, parser)); //context.Map.Add("@PassiveObjects", new AllObjectsRule(salience, false, memory, produceTranslator, tagger, parser)); context.Map.Add("@EntityPrep", new EntityPrepRule(salience, memory, verbs, tagger, parser)); context.Map.Add("@SubjectTense", new TenseRule(salience, Relations.Relation.Subject, memory, verbs, nouns, tagger, parser)); context.Map.Add("%unknown", new UnknownConceptVariable("%unknown", null)); context.Map.Add("%unevent", new UnknownConceptVariable("%unevent", Concept.Kind.Event)); context.Map.Add("%unthing", new UnknownConceptVariable("%unthing", Concept.Kind.Entity)); context.Map.Add("%unquality", new UnknownConceptVariable("%unquality", Concept.Kind.Attribute)); }