internal Adjective(Ontology ontology, string[] name) : base(ontology, name) { Name = name; Ontology.AllAdjectives[name] = this; Ontology.Store(name, this); Driver.Driver.AppendResponseLine($"Learned the adjective <b><i>{name.Untokenize()}</i></b>."); }
internal ProperNoun(Ontology ontology, string[] name) : base(ontology, name) { Name = name; Individual = Ontology.PermanentIndividual(new MonadicConceptLiteral[0], Name); Driver.Driver.AppendResponseLine($"Learned the new proper name <b><i>{Name.Untokenize()}</i></b>."); Ontology.AllNouns[Name] = this; }
internal Part(Ontology ontology, string[] name, int count, CommonNoun kind, IEnumerable <MonadicConceptLiteral> modifiers) : base(ontology, name) { Name = name; Ontology.AllParts[name] = this; Count = count; Kind = kind; Modifiers = modifiers.ToArray(); }
internal Individual(Ontology ontology, IEnumerable <MonadicConceptLiteral> concepts, string[] name, Individual container = null, Part containerPart = null, bool ephemeral = false) : base(ontology, name, ephemeral) { Name = name; Container = container; ContainerPart = containerPart; var enumerated = concepts as MonadicConceptLiteral[] ?? concepts.ToArray(); Kinds.AddRange(enumerated.Where(l => l.IsPositive && l.Concept is CommonNoun).Select(l => (CommonNoun)l.Concept).Distinct()); // Remove redundant kinds for (var i = Kinds.Count - 1; i >= 0; i--) { var kind = Kinds[i]; foreach (var possibleSubKind in Kinds) { if (possibleSubKind != kind && possibleSubKind.IsSubKindOf(kind)) { // Listing kind is redundant Kinds.RemoveAt(i); break; } } } Modifiers.AddRange(enumerated.Where(l => !l.IsPositive || !(l.Concept is CommonNoun))); }
internal CommonNoun(Ontology ontology, string[] name) : base(ontology, name) { }
internal Verb(Ontology ontology) : base(ontology, null) { }
/// <summary> /// Make a new referent. /// </summary> /// <param name="name">Name of the referent</param> /// <param name="ephemeral">True if this referent will exist only in one generator, and is not being added to the ontology</param> /// <param name="ontology">Ontology within which the referent exists</param> protected Referent(Ontology ontology, string[] name, bool ephemeral = false) { Ontology = ontology; Ontology.CheckTerminologyCanBeAdded(name, GetType(), !ephemeral); }
/// <summary> /// Makes Concept /// </summary> protected Concept(Ontology ontology, string[] name) : base(ontology, name) { }
/// <summary> /// Makes a new noun /// </summary> protected Noun(Ontology ontology, string[] name) : base(ontology, name) { }
internal TokenTrie(Ontology ontology) : base(ontology) { }
/// <summary> /// Make a new TokenTrie /// </summary> protected TokenTrieBase(Ontology ontology) { ontology.AllTokenTries.Add(this); }
internal Property(Ontology ontology, string[] name, VariableType type) : base(ontology, name) { Name = name; Ontology.AllProperties[name] = this; Type = type; }