コード例 #1
0
 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>.");
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 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();
 }
コード例 #4
0
        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)));
        }
コード例 #5
0
 internal CommonNoun(Ontology ontology, string[] name) : base(ontology, name)
 {
 }
コード例 #6
0
ファイル: Verb.cs プロジェクト: ianhorswill/ImaginariumCore
 internal Verb(Ontology ontology) : base(ontology, null)
 {
 }
コード例 #7
0
 /// <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);
 }
コード例 #8
0
 /// <summary>
 /// Makes Concept
 /// </summary>
 protected Concept(Ontology ontology, string[] name) : base(ontology, name)
 {
 }
コード例 #9
0
ファイル: Noun.cs プロジェクト: ianhorswill/ImaginariumCore
 /// <summary>
 /// Makes a new noun
 /// </summary>
 protected Noun(Ontology ontology, string[] name) : base(ontology, name)
 {
 }
コード例 #10
0
 internal TokenTrie(Ontology ontology) : base(ontology)
 {
 }
コード例 #11
0
 /// <summary>
 /// Make a new TokenTrie
 /// </summary>
 protected TokenTrieBase(Ontology ontology)
 {
     ontology.AllTokenTries.Add(this);
 }
コード例 #12
0
 internal Property(Ontology ontology, string[] name, VariableType type) : base(ontology, name)
 {
     Name = name;
     Ontology.AllProperties[name] = this;
     Type = type;
 }