summaryrefslogtreecommitdiff
path: root/src/cdec.cc
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2009-12-06 22:25:25 -0500
committerChris Dyer <redpony@gmail.com>2009-12-06 22:25:25 -0500
commit2a18010e255810cc2b5bcbe688f3db8eabda23ca (patch)
treee310286257e5445072303dcca03acb85a865c26a /src/cdec.cc
parent59ea352f3dcf3bf58969f404615fed4ff6b931f7 (diff)
add compound splitting logic and features (Dyer 2008, NAACL)
Diffstat (limited to 'src/cdec.cc')
-rw-r--r--src/cdec.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cdec.cc b/src/cdec.cc
index c5780cef..7bdf7bcc 100644
--- a/src/cdec.cc
+++ b/src/cdec.cc
@@ -17,6 +17,7 @@
#include "sampler.h"
#include "sparse_vector.h"
#include "lexcrf.h"
+#include "csplit.h"
#include "weights.h"
#include "tdict.h"
#include "ff.h"
@@ -46,7 +47,7 @@ void ShowBanner() {
void InitCommandLine(int argc, char** argv, po::variables_map* conf) {
po::options_description opts("Configuration options");
opts.add_options()
- ("formalism,f",po::value<string>()->default_value("scfg"),"Translation formalism; values include SCFG, FST, or PB. Specify LexicalCRF for experimental unsupervised CRF word alignment")
+ ("formalism,f",po::value<string>()->default_value("scfg"),"Translation formalism; values include SCFG, FST, PB, LexCRF (lexical translation model), CSPLIT (compound splitting)")
("input,i",po::value<string>()->default_value("-"),"Source file")
("grammar,g",po::value<vector<string> >()->composing(),"Either SCFG grammar file(s) or phrase tables file(s)")
("weights,w",po::value<string>(),"Feature weights file")
@@ -100,14 +101,14 @@ void InitCommandLine(int argc, char** argv, po::variables_map* conf) {
exit(1);
}
- if (conf->count("help") || conf->count("grammar") == 0) {
+ if (conf->count("help") || conf->count("formalism") == 0) {
cerr << dcmdline_options << endl;
exit(1);
}
const string formalism = LowercaseString((*conf)["formalism"].as<string>());
- if (formalism != "scfg" && formalism != "fst" && formalism != "lexcrf" && formalism != "pb") {
- cerr << "Error: --formalism takes only 'scfg', 'fst', 'pb', or 'lexcrf'\n";
+ if (formalism != "scfg" && formalism != "fst" && formalism != "lexcrf" && formalism != "pb" && formalism != "csplit") {
+ cerr << "Error: --formalism takes only 'scfg', 'fst', 'pb', 'csplit' or 'lexcrf'\n";
cerr << dcmdline_options << endl;
exit(1);
}
@@ -231,6 +232,8 @@ int main(int argc, char** argv) {
translator.reset(new FSTTranslator(conf));
else if (formalism == "pb")
translator.reset(new PhraseBasedTranslator(conf));
+ else if (formalism == "csplit")
+ translator.reset(new CompoundSplit(conf));
else if (formalism == "lexcrf")
translator.reset(new LexicalCRF(conf));
else