Example #1
0
 internal Invention(Ontology.Ontology ontology, Generator generator, Solution model)
 {
     Ontology            = ontology;
     Generator           = generator;
     Model               = model;
     PossibleIndividuals = new List <PossibleIndividual>(Individuals.Count);
     PossibleIndividuals.AddRange(Individuals.Select(i => new PossibleIndividual(i, this)));
 }
Example #2
0
 /// <summary>
 /// Creates a generator for objects of the specified types
 /// </summary>
 /// <param name="noun">Base common noun for the object</param>
 /// <param name="concepts">Other monadic concepts that must be true of the object</param>
 /// <param name="count">Number of objects of the specified type to include</param>
 public Generator(CommonNoun noun, IEnumerable <MonadicConceptLiteral> concepts, int count = 1)
 {
     Ontology = noun.Ontology;
     Count    = count;
     Noun     = noun;
     Concepts = concepts.ToArray();
     Rebuild();
 }
Example #3
0
 /// <inheritdoc />
 public Parser(Ontology.Ontology o, params Func <Parser, IEnumerable <SentencePattern> >[] commandSets)
 {
     Ontology = o;
     InitializeConstituents();
     Is         = MatchCopula;
     Has        = MatchHave;
     Count      = () => MatchInt(out ParsedCount);
     UpperBound = () => MatchFloat(out ParsedUpperBound);
     LowerBound = () => MatchFloat(out ParsedLowerBound);
     StandardSentencePatterns(o);
     foreach (var set in commandSets)
     {
         SentencePatterns.AddRange(set(this));
     }
 }
Example #4
0
 internal void StandardSentencePatterns(Ontology.Ontology ontology)
 {
     SentencePatterns.AddRange(new[]