|
Natural Language Processing
0.1.0
|
The SyntaxTree class The Tree specialized for holding syntax and words INHERITS: from Tree. More...
#include <syntaxtree.h>
Public Member Functions | |
| SyntaxTree () | |
| SyntaxTree::SyntaxTree Default Constructor. | |
| SyntaxTree (TNpair *root) | |
| SyntaxTree::SyntaxTree Constructor. More... | |
| SyntaxTree (const SyntaxTree &S) | |
| SyntaxTree::SyntaxTree Copy Constructor. More... | |
| SyntaxTree & | operator= (const SyntaxTree &S) |
| SyntaxTree::operator = assignment operator. More... | |
| ~SyntaxTree () | |
| SyntaxTree::~SyntaxTree Destructor. | |
| void | assignHeads () |
| SyntaxTree::assignHeads assigns the head words to each node. | |
| void | assignObjects () |
| SyntaxTree::assignObjects assigns the syntax to each node. | |
| void | determineType () |
| SyntaxTree::determineType Determines sentence type. | |
| void | addDef (GPlist def) |
| SyntaxTree::addDef Adds the Definition to the current node (the children) More... | |
| void | removeDef () |
| SyntaxTree::removeDef Removes the definition of current_exception() NOTE: It will remove all of the children of the definitions. | |
| GPlist | getDef () |
| SyntaxTree::getDef Returns the definition as a vector of grammar phrases of current. | |
| GrammarPhrase | getPhrase () |
| SyntaxTree::getPhrase Returns the phrase at current. More... | |
| bool | atLeaf () |
| SyntaxTree::atLeaf Checks if current is a leaf. More... | |
| TNpair * | getLastLeaf () |
| SyntaxTree::getLastLeaf Returns the Rightmost bottom leaf. More... | |
| TNpair * | getFirstLeaf () |
| SyntaxTree::getFirstLeaf Returns the leftmost bottom leaf. More... | |
| TNpair * | getChildAt (std::size_t i) |
| SyntaxTree::getChildAt gets the child at index of current. More... | |
| bool | atLastLeaf () |
| SyntaxTree::atLastLeaf Checks if current is at the last leaf. More... | |
| bool | atFirstLeaf () |
| SyntaxTree::atFirstLeaf Checks if current is at the first leaf. More... | |
| std::size_t | leavesBefore () |
| SyntaxTree::leavesBefore Calculates the number of leaves before current. More... | |
| std::size_t | childIndex (TNpair *parent, TNpair *child) |
| SyntaxTree::childIndex Calculates which child is the child (from 0) More... | |
| std::vector< SyntaxWord > | getAll () const |
| SyntaxTree::getAll Gets all of the syntax words. More... | |
| std::vector< SyntaxWord > | getObj (SyntaxObject S) const |
| SyntaxTree::getObj Gets all of the instances of the syntax object. More... | |
| SentenceType | getSentenceType () const |
| SyntaxTree::getSentenceType gets the sentence type. More... | |
| SyntaxObject | askingFor () const |
| SyntaxTree::askingFor Gets the syntaxobject the question is asking for, if it is a question. More... | |
Public Member Functions inherited from Tree< GtSpair > | |
| Tree () | |
| Tree Default Constructor. | |
| Tree (TreeNode< GtSpair > *root) | |
| Tree Constructor. More... | |
| Tree (const Tree< GtSpair > &T) | |
| Tree Copy Constructor. More... | |
| ~Tree () | |
| ~Tree Destructor | |
| Tree< GtSpair > & | operator= (const Tree< GtSpair > &T) |
| operator = assignment operator More... | |
| void | addHere (const GtSpair &item) |
| addHere Adds an item as a child to the current node More... | |
| void | addNode (TreeNode< GtSpair > *parent, const GtSpair &item) |
| addNode Adds an item as a child to the parent More... | |
| TreeNode< GtSpair > * | search (const GtSpair &item) |
| search searches for a specific item More... | |
| bool | inTree (TreeNode< GtSpair > *node) |
| inTree Checks if the node is part of the tree More... | |
| bool | empty () const |
| empty Checks if the tree is empty More... | |
| void | clear () |
| clear Clears the tree | |
| std::size_t | leafNum () |
| leafNum Counts the number of leaves in the tree More... | |
| TreeNode< GtSpair > * | getParent (TreeNode< GtSpair > *branch) |
| getParent Gets the parent of the branch More... | |
| TreeNode< GtSpair > * | getCurrent () |
| getCurrent Returns the current node pointer More... | |
| void | set (const GtSpair &item) |
| set Set the item of the current node More... | |
| void | shiftToRoot () |
| shiftToRoot shift the current to the root | |
| void | shiftUp () |
| shiftUp Shift the current to its parent | |
| void | shiftDown (std::size_t child) |
| shiftDown Shift the current to one of its children More... | |
| void | shiftTo (TreeNode< GtSpair > *target) |
| shiftTo Shift the current to the specified target More... | |
| bool | hasParent () |
| hasParent Checks if current has a parent More... | |
| bool | hasChild () |
| hasChild Checks if current has children More... | |
| std::size_t | childNum () |
| childNum Finds the number of children of current More... | |
| GtSpair & | get () |
| get Returns the item of current More... | |
| std::size_t | size () const |
| size Returns the size of the tree More... | |
| std::vector< TreeNode< GtSpair > * > | getLeaves () |
| getLeaves Returns a vector of the leaves of the tree More... | |
Static Public Member Functions | |
| static string | getSyntaxEncoding (const vector< SyntaxWord > &SWord) |
| SyntaxTree::getSyntaxEncoding External function that should be part of SyntaxTree, function does not use any of member variales. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Tree< GtSpair > | |
| TreeNode< GtSpair > * | _root |
| _root the root of the tree | |
| TreeNode< GtSpair > * | _current |
| _current the treenode in which many operations are performed. Can be changed via shift functions | |
The SyntaxTree class The Tree specialized for holding syntax and words INHERITS: from Tree.
| SyntaxTree::SyntaxTree | ( | TNpair * | root | ) |
SyntaxTree::SyntaxTree Constructor.
| root | the root |
| SyntaxTree::SyntaxTree | ( | const SyntaxTree & | S | ) |
SyntaxTree::SyntaxTree Copy Constructor.
| S | SyntaxTree |
| void SyntaxTree::addDef | ( | GPlist | def | ) |
SyntaxTree::addDef Adds the Definition to the current node (the children)
| def | the definition (children) |
| SyntaxObject SyntaxTree::askingFor | ( | ) | const |
SyntaxTree::askingFor Gets the syntaxobject the question is asking for, if it is a question.
| bool SyntaxTree::atFirstLeaf | ( | ) |
SyntaxTree::atFirstLeaf Checks if current is at the first leaf.
| bool SyntaxTree::atLastLeaf | ( | ) |
SyntaxTree::atLastLeaf Checks if current is at the last leaf.
| bool SyntaxTree::atLeaf | ( | ) |
SyntaxTree::atLeaf Checks if current is a leaf.
SyntaxTree::childIndex Calculates which child is the child (from 0)
| parent | the parent |
| child | the child |
| std::vector< SyntaxWord > SyntaxTree::getAll | ( | ) | const |
SyntaxTree::getAll Gets all of the syntax words.
| TNpair * SyntaxTree::getChildAt | ( | std::size_t | i | ) |
| TNpair * SyntaxTree::getFirstLeaf | ( | ) |
SyntaxTree::getFirstLeaf Returns the leftmost bottom leaf.
| TNpair * SyntaxTree::getLastLeaf | ( | ) |
SyntaxTree::getLastLeaf Returns the Rightmost bottom leaf.
| std::vector< SyntaxWord > SyntaxTree::getObj | ( | SyntaxObject | S | ) | const |
SyntaxTree::getObj Gets all of the instances of the syntax object.
| S | the syntax object |
| GrammarPhrase SyntaxTree::getPhrase | ( | ) |
SyntaxTree::getPhrase Returns the phrase at current.
| SentenceType SyntaxTree::getSentenceType | ( | ) | const |
SyntaxTree::getSentenceType gets the sentence type.
|
static |
SyntaxTree::getSyntaxEncoding External function that should be part of SyntaxTree, function does not use any of member variales.
| SWord |
| std::size_t SyntaxTree::leavesBefore | ( | ) |
SyntaxTree::leavesBefore Calculates the number of leaves before current.
| SyntaxTree & SyntaxTree::operator= | ( | const SyntaxTree & | S | ) |
1.8.6