Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/training/phrase-extract/SyntaxTree.h')
-rw-r--r--scripts/training/phrase-extract/SyntaxTree.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/training/phrase-extract/SyntaxTree.h b/scripts/training/phrase-extract/SyntaxTree.h
index 0ca5ca472..17c106b49 100644
--- a/scripts/training/phrase-extract/SyntaxTree.h
+++ b/scripts/training/phrase-extract/SyntaxTree.h
@@ -34,12 +34,14 @@ protected:
std::string m_label;
std::vector< SyntaxNode* > m_children;
SyntaxNode* m_parent;
+ float m_pcfgScore;
public:
SyntaxNode( int startPos, int endPos, std::string label )
:m_start(startPos)
,m_end(endPos)
,m_label(label)
,m_parent(0)
+ ,m_pcfgScore(0.0f)
{}
int GetStart() const {
return m_start;
@@ -50,6 +52,12 @@ public:
std::string GetLabel() const {
return m_label;
}
+ float GetPcfgScore() const {
+ return m_pcfgScore;
+ }
+ void SetPcfgScore(float score) {
+ m_pcfgScore = score;
+ }
SyntaxNode *GetParent() {
return m_parent;
}
@@ -89,11 +97,12 @@ public:
}
~SyntaxTree();
+ SyntaxNode *AddNode( int startPos, int endPos, std::string label );
+
SyntaxNode *GetTop() {
return m_top;
}
- void AddNode( int startPos, int endPos, std::string label );
ParentNodes Parse();
bool HasNode( int startPos, int endPos ) const;
const std::vector< SyntaxNode* >& GetNodes( int startPos, int endPos ) const;