diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2012-05-31 20:24:06 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2012-05-31 20:24:06 +0400 |
commit | 4eef94b1217a82eb979242dd3e06d8a4b6255e6e (patch) | |
tree | bab044ee77c9bf699954ea789078f4c885d66723 /phrase-extract/extract-ghkm/ParseTree.cpp | |
parent | c3d4615fc012a5ad5b33a2b587df31064e0ec82b (diff) |
move c++ code out of /script/ to /
Diffstat (limited to 'phrase-extract/extract-ghkm/ParseTree.cpp')
-rw-r--r-- | phrase-extract/extract-ghkm/ParseTree.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/phrase-extract/extract-ghkm/ParseTree.cpp b/phrase-extract/extract-ghkm/ParseTree.cpp new file mode 100644 index 000000000..052b8dee1 --- /dev/null +++ b/phrase-extract/extract-ghkm/ParseTree.cpp @@ -0,0 +1,54 @@ +/*********************************************************************** + Moses - statistical machine translation system + Copyright (C) 2006-2011 University of Edinburgh + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +***********************************************************************/ + +#include "ParseTree.h" + +namespace Moses { +namespace GHKM { + +ParseTree::~ParseTree() +{ + for (std::vector<ParseTree*>::iterator p(m_children.begin()); + p != m_children.end(); ++p) { + delete *p; + } +} + +void ParseTree::SetChildren(const std::vector<ParseTree*> &children) +{ + m_children = children; +} + +void ParseTree::SetParent(ParseTree *parent) +{ + m_parent = parent; +} + +void ParseTree::AddChild(ParseTree *child) +{ + m_children.push_back(child); +} + +bool ParseTree::IsLeaf() const +{ + return m_children.empty(); +} + +} // namespace GHKM +} // namespace Moses |