4 #include "../Grammar Structure/Grammar-with-Map/grammar.h"
7 #include "syntaxword.h"
12 typedef std::pair<GrammarPhrase,SyntaxWord> GPSWpair;
44 out <<
"( " << phraseLookUp[G.
_d.first] <<
" , " << G.
_d.second <<
" )";
74 void recurHead(
TNpair* root);
79 void setSubj(
TNpair* sentence);
80 void setMV(
TNpair* sentence);
81 void setDO(
TNpair* sentence);
82 void setIDO(
TNpair* sentence);
83 void setQ(
TNpair* sentence);
84 void setAux(
TNpair* sentence);
85 void setAtt(
TNpair *sentence);
119 std::vector<SyntaxWord>
getAll()
const;
127 #endif // SYNTAXTREE_H
SyntaxObject askingFor() const
SyntaxTree::askingFor Gets the syntaxobject the question is asking for, if it is a question...
Definition: syntaxtree.cpp:231
GSContainerpair()
GSContainerpair Default Constructor.
Definition: syntaxtree.h:26
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.
Definition: syntaxtree.cpp:54
bool atFirstLeaf()
SyntaxTree::atFirstLeaf Checks if current is at the first leaf.
Definition: syntaxtree.cpp:155
void removeDef()
SyntaxTree::removeDef Removes the definition of current_exception() NOTE: It will remove all of the c...
Definition: syntaxtree.cpp:79
GSContainerpair(GrammarPhrase g, const SyntaxWord &W)
GSContainerpair Constructor.
Definition: syntaxtree.h:33
std::size_t leavesBefore()
SyntaxTree::leavesBefore Calculates the number of leaves before current.
Definition: syntaxtree.cpp:163
void determineType()
SyntaxTree::determineType Determines sentence type.
Definition: syntaxtree.cpp:276
bool atLastLeaf()
SyntaxTree::atLastLeaf Checks if current is at the last leaf.
Definition: syntaxtree.cpp:147
SyntaxTree & operator=(const SyntaxTree &S)
SyntaxTree::operator = assignment operator.
Definition: syntaxtree.cpp:33
TNpair * getFirstLeaf()
SyntaxTree::getFirstLeaf Returns the leftmost bottom leaf.
Definition: syntaxtree.cpp:125
GrammarPhrase getPhrase()
SyntaxTree::getPhrase Returns the phrase at current.
Definition: syntaxtree.cpp:98
GPSWpair _d
_d the pair
Definition: syntaxtree.h:21
SyntaxTree()
SyntaxTree::SyntaxTree Default Constructor.
Definition: syntaxtree.cpp:6
std::vector< SyntaxWord > getAll() const
SyntaxTree::getAll Gets all of the syntax words.
Definition: syntaxtree.cpp:196
SyntaxObject
Definition: config.h:167
~SyntaxTree()
SyntaxTree::~SyntaxTree Destructor.
Definition: syntaxtree.cpp:43
void assignHeads()
SyntaxTree::assignHeads assigns the head words to each node.
Definition: syntaxtree.cpp:254
SentenceType getSentenceType() const
SyntaxTree::getSentenceType gets the sentence type.
Definition: syntaxtree.cpp:223
void addDef(GPlist def)
SyntaxTree::addDef Adds the Definition to the current node (the children)
Definition: syntaxtree.cpp:70
friend std::ostream & operator<<(std::ostream &out, const GSContainerpair &G)
operator << insertion
Definition: syntaxtree.h:43
bool atLeaf()
SyntaxTree::atLeaf Checks if current is a leaf.
Definition: syntaxtree.cpp:106
std::vector< SyntaxWord > getObj(SyntaxObject S) const
SyntaxTree::getObj Gets all of the instances of the syntax object.
Definition: syntaxtree.cpp:209
TNpair * getChildAt(std::size_t i)
SyntaxTree::getChildAt gets the child at index of current.
Definition: syntaxtree.cpp:137
void assignObjects()
SyntaxTree::assignObjects assigns the syntax to each node.
Definition: syntaxtree.cpp:261
std::vector< TreeNode * > TNvector
TNvector typedef of std::vector<TreeNode*>
Definition: Tree.h:17
TNpair * getLastLeaf()
SyntaxTree::getLastLeaf Returns the Rightmost bottom leaf.
Definition: syntaxtree.cpp:114
The GSContainerpair struct Container for a GPSWpair.
Definition: syntaxtree.h:17
std::vector< GrammarPhrase > GPlist
GPlist typedef for vector<GrammarPhrase>
Definition: config.h:265
GPlist getDef()
SyntaxTree::getDef Returns the definition as a vector of grammar phrases of current.
Definition: syntaxtree.cpp:86
The SyntaxWord class Container for a Word and a Syntax Identifier.
Definition: syntaxword.h:10
std::size_t childIndex(TNpair *parent, TNpair *child)
SyntaxTree::childIndex Calculates which child is the child (from 0)
Definition: syntaxtree.cpp:184
GrammarPhrase
The GrammarPhrase enum Denotes the Grammar Phrase.
Definition: config.h:99
The SyntaxTree class The Tree specialized for holding syntax and words INHERITS: from Tree...
Definition: syntaxtree.h:68