diff options
Diffstat (limited to 'scripts/training/phrase-extract.6/LatticeNode.h')
-rw-r--r-- | scripts/training/phrase-extract.6/LatticeNode.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/scripts/training/phrase-extract.6/LatticeNode.h b/scripts/training/phrase-extract.6/LatticeNode.h new file mode 100644 index 000000000..1feefc28f --- /dev/null +++ b/scripts/training/phrase-extract.6/LatticeNode.h @@ -0,0 +1,45 @@ +#pragma once +/* + * LatticeNode.h + * extract + * + * Created by Hieu Hoang on 18/07/2010. + * Copyright 2010 __MyCompanyName__. All rights reserved. + * + */ +#include <vector> +#include <iostream> + +class Tunnel; +class SyntaxNode; +class SentenceAlignment; +class SymbolSequence; + +class LatticeNode +{ +public: + static size_t s_count; + + const Tunnel &m_hole; + bool m_isTerminal; + const SyntaxNode *m_sourceTreeNode, *m_targetTreeNode; + const SentenceAlignment *m_sentence; + + // for terms + LatticeNode(const Tunnel &hole, const SentenceAlignment *sentence); + + // for non-terms + LatticeNode(const Tunnel &hole, const SyntaxNode *sourceTreeNode, const SyntaxNode *targetTreeNode); + + bool IsSyntax() const; + + size_t GetNumSymbols(size_t direction) const; + + std::string ToString(size_t direction) const; + + int Compare(const LatticeNode &otherNode) const; + + void CreateSymbols(size_t direction, SymbolSequence &symbols) const; + +}; + |