SyntaxNode

SyntaxNode class description

Namespace: Nlp4Net.NlpLib Assembly: NlpLib.dll

public class SyntaxNode : IUserData, ICloneable


SyntaxNode is used to build a Reed-Kellogg tree graph. The root of a tree graph represents a syntax diagram of an Utterance. Utterance allows mutual diagrams when syntax is ambiguous.

SyntaxNode may have associated Words.

SyntaxNode has methods allowing sorting and search operations.

SyntaxNode allows syntax graph transformation. For example Utterance can be simplified by cutting less important parts. Another typical transformation is conversion between question and answer forms in natural language queries.




Constructors Description
Nlp4Net method SyntaxNode() creates an empty SyntaxNode
Nlp4Net method SyntaxNode(SyntaxNode other) copy constructor
Nlp4Net method SyntaxNode(RKStructt syntaxType, RKRole syntaxRole) initializes SyntaxNode with Reed-Kellogg role and Reed-Kellogg structure
Nlp4Net method SyntaxNode(RKStruct syntaxType, RKRole syntaxRole, Word word) initializes SyntaxNode with Reed-Kellogg role, Reed-Kellogg structure and Word



Methods Description
Nlp4Net method void Add(SyntaxNode child) Adds a child node.
Nlp4Net method void Clear() Removes all children and words associated with this node.
Nlp4Net method object ICloneable.Clone() duplicates SyntaxNode
Nlp4Net method SyntaxNode Find(Predicate<SyntaxNode> match) Finds first node, matching the predicate, down the tree graph.
Nlp4Net method SyntaxNode Find(Traverse traverse, Predicate<SyntaxNode> match) Finds first node, matching the predicate.
Traverses the tree graph beginning from this node as specified in the first parameter.
Nlp4Net method SyntaxNode[] FindAll(Predicate<SyntaxNode> match) Finds all nodes, matching the predicate, down the tree graph.
Nlp4Net method SyntaxNode[] FindAll(Traverse traverse, Predicate<SyntaxNode> match) Finds all nodes matching the predicate.
Traverses the tree graph beginning from this node as specified in the first parameter.
Nlp4Net method void ForEach(Action<SyntaxNode> action) Executes the action down the tree graph.
Nlp4Net method void ForEach(Traverse traverse, Action<SyntaxNode> action) Executes the action going through tree graph as specified by traverse parameter.
Nlp4Net method (IEnumerator<SyntaxNode> GetEnumerator() Enumerates direct children.
Nlp4Net method void Insert(int index, SyntaxNode child) Inserts a child node at specified index.
Nlp4Net method bool Remove(SyntaxNode child) Removes the child node, returns true if node was found.
Nlp4Net method void RemoveAt(int index) Removes child node at zero-based index.
Nlp4Net method void Sort(IComparer<SyntaxNode> comparer) Sorts underlying tree graph.
Nlp4Net method void Sort(Traverse traverse, IComparer<SyntaxNode> comparer) Sorts tree graph in the direction specified by traverse parameter.
Nlp4Net method void Sort(Comparison<SyntaxNode> comparison) Sorts underlying tree graph.
Nlp4Net method void Sort(Traverse traverse, Comparison<SyntaxNode> comparison) Sorts tree graph in the direction specified by traverse parameter.



Properties Description
Nlp4Net property int Count Number of direct children.
Nlp4Net propertySyntaxNode.Flag Flags Additional syntax hints to simplify analysis of Reed-Kellogg graph.
Nlp4Net property SyntaxNode this[int i] Child SyntaxNode
Nlp4Net property int LCID LCID of applied syntax.
Nlp4Net property RKRole NodeRole Reed-Kellogg syntax role of this node in the graph.
Nlp4Net property RKStruct NodeType Reed-Kellogg syntax structure associated with this node in the graph.
Nlp4Net property SyntaxNode Parent Parent node.
The property is null for the root node.
Nlp4Net propertyList<Word> Words List of associated words.
Usually Node has a single word, but may have no words or many words.