diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2014-05-07 20:22:52 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2014-05-07 20:22:52 +0400 |
commit | 221c8d150531733271e44dc515e32910e580fe97 (patch) | |
tree | 8c533b33e2bcc0499cd718e91c3632e337ab606f /contrib/other-builds/extract-mixed-syntax | |
parent | 1b7ed9e6514aa91aff31b26d4e4eed17cc32fa59 (diff) |
comments
Diffstat (limited to 'contrib/other-builds/extract-mixed-syntax')
7 files changed, 9 insertions, 1 deletions
diff --git a/contrib/other-builds/extract-mixed-syntax/Main.cpp b/contrib/other-builds/extract-mixed-syntax/Main.cpp index f5d12f651..4cb5c92e6 100644 --- a/contrib/other-builds/extract-mixed-syntax/Main.cpp +++ b/contrib/other-builds/extract-mixed-syntax/Main.cpp @@ -35,7 +35,8 @@ int main(int argc, char** argv) ("TargetSyntax", "Target sentence is a parse tree") ("MixedSyntaxType", po::value<int>()->default_value(params.mixedSyntaxType), "Hieu's Mixed syntax type. 0(default)=no mixed syntax, 1=add [X] only if no syntactic label. 2=add [X] everywhere") ("MultiLabel", po::value<int>()->default_value(params.multiLabel), "What to do with multiple labels on the same span. 0(default)=keep them all, 1=keep only top-most, 2=keep only bottom-most") - ("HieroSourceLHS", "Always use Hiero source LHS? Default = 0"); + ("HieroSourceLHS", "Always use Hiero source LHS? Default = 0") + ("MaxSpanFreeNonTermSource", "Max number of words covered by beginning/end NT. Default = 0 (no limit)"); po::variables_map vm; try @@ -74,6 +75,7 @@ int main(int argc, char** argv) if (vm.count("MixedSyntaxType")) params.mixedSyntaxType = vm["MixedSyntaxType"].as<int>(); if (vm.count("MultiLabel")) params.multiLabel = vm["MultiLabel"].as<int>(); if (vm.count("HieroSourceLHS")) params.hieroSourceLHS = true; + if (vm.count("MaxSpanFreeNonTermSource")) params.maxSpanFreeNonTermSource = vm["MaxSpanFreeNonTermSource"].as<int>(); // input files; string pathTarget = argv[1]; diff --git a/contrib/other-builds/extract-mixed-syntax/Parameter.cpp b/contrib/other-builds/extract-mixed-syntax/Parameter.cpp index 2dd041c10..1a1b213bc 100644 --- a/contrib/other-builds/extract-mixed-syntax/Parameter.cpp +++ b/contrib/other-builds/extract-mixed-syntax/Parameter.cpp @@ -27,6 +27,7 @@ Parameter::Parameter() ,multiLabel(0) ,nonTermConsecSourceMixed(true) ,hieroSourceLHS(false) +,maxSpanFreeNonTermSource(0) {} Parameter::~Parameter() { diff --git a/contrib/other-builds/extract-mixed-syntax/Parameter.h b/contrib/other-builds/extract-mixed-syntax/Parameter.h index 49be95a8a..fbed7a1b8 100644 --- a/contrib/other-builds/extract-mixed-syntax/Parameter.h +++ b/contrib/other-builds/extract-mixed-syntax/Parameter.h @@ -36,6 +36,7 @@ public: int mixedSyntaxType, multiLabel; bool nonTermConsecSourceMixed; bool hieroSourceLHS; + int maxSpanFreeNonTermSource; }; diff --git a/contrib/other-builds/extract-mixed-syntax/Phrase.h b/contrib/other-builds/extract-mixed-syntax/Phrase.h index 8d52d23b3..13912cb95 100644 --- a/contrib/other-builds/extract-mixed-syntax/Phrase.h +++ b/contrib/other-builds/extract-mixed-syntax/Phrase.h @@ -3,6 +3,7 @@ #include <vector> #include "Word.h" +// a vector of terminals class Phrase : public std::vector<Word*> { public: diff --git a/contrib/other-builds/extract-mixed-syntax/RulePhrase.h b/contrib/other-builds/extract-mixed-syntax/RulePhrase.h index 382b50d37..0bb170644 100644 --- a/contrib/other-builds/extract-mixed-syntax/RulePhrase.h +++ b/contrib/other-builds/extract-mixed-syntax/RulePhrase.h @@ -14,6 +14,7 @@ class RuleSymbol; +// a phrase of terms and non-terms for 1 side of a rule class RulePhrase { public: diff --git a/contrib/other-builds/extract-mixed-syntax/RuleSymbol.h b/contrib/other-builds/extract-mixed-syntax/RuleSymbol.h index ef86a5034..c292fcc0d 100644 --- a/contrib/other-builds/extract-mixed-syntax/RuleSymbol.h +++ b/contrib/other-builds/extract-mixed-syntax/RuleSymbol.h @@ -11,6 +11,7 @@ #include <iostream> #include <string> +// base class - terminal or non-term class RuleSymbol { public: RuleSymbol(); diff --git a/contrib/other-builds/extract-mixed-syntax/Word.h b/contrib/other-builds/extract-mixed-syntax/Word.h index 251cbac4f..46feba07c 100644 --- a/contrib/other-builds/extract-mixed-syntax/Word.h +++ b/contrib/other-builds/extract-mixed-syntax/Word.h @@ -10,6 +10,7 @@ #include <set> #include "RuleSymbol.h" +// a terminal class Word : public RuleSymbol { public: |