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 | |
parent | c3d4615fc012a5ad5b33a2b587df31064e0ec82b (diff) |
move c++ code out of /script/ to /
-rw-r--r-- | Jamroot | 2 | ||||
-rw-r--r-- | phrase-extract/AlignmentPhrase.cpp (renamed from scripts/training/phrase-extract/AlignmentPhrase.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/AlignmentPhrase.h (renamed from scripts/training/phrase-extract/AlignmentPhrase.h) | 0 | ||||
-rw-r--r-- | phrase-extract/ExtractedRule.cpp (renamed from scripts/training/phrase-extract/ExtractedRule.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/ExtractedRule.h (renamed from scripts/training/phrase-extract/ExtractedRule.h) | 0 | ||||
-rw-r--r-- | phrase-extract/Hole.h (renamed from scripts/training/phrase-extract/Hole.h) | 0 | ||||
-rw-r--r-- | phrase-extract/HoleCollection.cpp (renamed from scripts/training/phrase-extract/HoleCollection.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/HoleCollection.h (renamed from scripts/training/phrase-extract/HoleCollection.h) | 0 | ||||
-rw-r--r-- | phrase-extract/InputFileStream.cpp (renamed from scripts/training/phrase-extract/InputFileStream.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/InputFileStream.h (renamed from scripts/training/phrase-extract/InputFileStream.h) | 0 | ||||
-rw-r--r-- | phrase-extract/Jamfile (renamed from scripts/training/phrase-extract/Jamfile) | 12 | ||||
-rw-r--r-- | phrase-extract/OutputFileStream.cpp (renamed from scripts/training/phrase-extract/OutputFileStream.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/OutputFileStream.h (renamed from scripts/training/phrase-extract/OutputFileStream.h) | 0 | ||||
-rw-r--r-- | phrase-extract/PhraseAlignment.cpp (renamed from scripts/training/phrase-extract/PhraseAlignment.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/PhraseAlignment.h (renamed from scripts/training/phrase-extract/PhraseAlignment.h) | 0 | ||||
-rw-r--r-- | phrase-extract/RuleExist.h (renamed from scripts/training/phrase-extract/RuleExist.h) | 0 | ||||
-rw-r--r-- | phrase-extract/RuleExtractionOptions.h (renamed from scripts/training/phrase-extract/RuleExtractionOptions.h) | 0 | ||||
-rw-r--r-- | phrase-extract/SafeGetline.h (renamed from scripts/training/phrase-extract/SafeGetline.h) | 0 | ||||
-rw-r--r-- | phrase-extract/SentenceAlignment.cpp (renamed from scripts/training/phrase-extract/SentenceAlignment.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/SentenceAlignment.h (renamed from scripts/training/phrase-extract/SentenceAlignment.h) | 0 | ||||
-rw-r--r-- | phrase-extract/SentenceAlignmentWithSyntax.cpp (renamed from scripts/training/phrase-extract/SentenceAlignmentWithSyntax.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/SentenceAlignmentWithSyntax.h (renamed from scripts/training/phrase-extract/SentenceAlignmentWithSyntax.h) | 0 | ||||
-rw-r--r-- | phrase-extract/SyntaxTree.cpp (renamed from scripts/training/phrase-extract/SyntaxTree.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/SyntaxTree.h (renamed from scripts/training/phrase-extract/SyntaxTree.h) | 0 | ||||
-rw-r--r-- | phrase-extract/XmlException.h (renamed from scripts/training/phrase-extract/XmlException.h) | 0 | ||||
-rw-r--r-- | phrase-extract/XmlTree.cpp (renamed from scripts/training/phrase-extract/XmlTree.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/XmlTree.h (renamed from scripts/training/phrase-extract/XmlTree.h) | 0 | ||||
-rw-r--r-- | phrase-extract/consolidate-direct.cpp (renamed from scripts/training/phrase-extract/consolidate-direct.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/consolidate-direct.vcxproj (renamed from scripts/training/phrase-extract/consolidate-direct.vcxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/consolidate-reverse.cpp (renamed from scripts/training/phrase-extract/consolidate-reverse.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/consolidate.cpp (renamed from scripts/training/phrase-extract/consolidate.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/consolidate.vcxproj (renamed from scripts/training/phrase-extract/consolidate.vcxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Alignment.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/Alignment.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Alignment.h (renamed from scripts/training/phrase-extract/extract-ghkm/Alignment.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/AlignmentGraph.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/AlignmentGraph.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/AlignmentGraph.h (renamed from scripts/training/phrase-extract/extract-ghkm/AlignmentGraph.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ComposedRule.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/ComposedRule.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ComposedRule.h (renamed from scripts/training/phrase-extract/extract-ghkm/ComposedRule.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Exception.h (renamed from scripts/training/phrase-extract/extract-ghkm/Exception.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ExtractGHKM.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/ExtractGHKM.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ExtractGHKM.h (renamed from scripts/training/phrase-extract/extract-ghkm/ExtractGHKM.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Jamfile | 1 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Main.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/Main.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Node.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/Node.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Node.h (renamed from scripts/training/phrase-extract/extract-ghkm/Node.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Options.h (renamed from scripts/training/phrase-extract/extract-ghkm/Options.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ParseTree.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/ParseTree.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ParseTree.h (renamed from scripts/training/phrase-extract/extract-ghkm/ParseTree.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ScfgRule.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/ScfgRule.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ScfgRule.h (renamed from scripts/training/phrase-extract/extract-ghkm/ScfgRule.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ScfgRuleWriter.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/ScfgRuleWriter.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/ScfgRuleWriter.h (renamed from scripts/training/phrase-extract/extract-ghkm/ScfgRuleWriter.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Span.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/Span.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Span.h (renamed from scripts/training/phrase-extract/extract-ghkm/Span.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Subgraph.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/Subgraph.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/Subgraph.h (renamed from scripts/training/phrase-extract/extract-ghkm/Subgraph.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/XmlTreeParser.cpp (renamed from scripts/training/phrase-extract/extract-ghkm/XmlTreeParser.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-ghkm/XmlTreeParser.h (renamed from scripts/training/phrase-extract/extract-ghkm/XmlTreeParser.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-lex.cpp (renamed from scripts/training/phrase-extract/extract-lex.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-lex.h (renamed from scripts/training/phrase-extract/extract-lex.h) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-lex.vcxproj (renamed from scripts/training/phrase-extract/extract-lex.vcxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-rules.cpp (renamed from scripts/training/phrase-extract/extract-rules.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract-rules.vcxproj (renamed from scripts/training/phrase-extract/extract-rules.vcxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/extract.cpp (renamed from scripts/training/phrase-extract/extract.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/extract.vcxproj (renamed from scripts/training/phrase-extract/extract.vcxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/extract.xcodeproj/project.pbxproj (renamed from scripts/training/phrase-extract/extract.xcodeproj/project.pbxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/gzfilebuf.h (renamed from scripts/training/phrase-extract/gzfilebuf.h) | 0 | ||||
-rw-r--r-- | phrase-extract/hierarchical.h (renamed from scripts/training/phrase-extract/hierarchical.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/Jamfile (renamed from scripts/training/phrase-extract/pcfg-common/Jamfile) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/exception.h (renamed from scripts/training/phrase-extract/pcfg-common/exception.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/numbered_set.h (renamed from scripts/training/phrase-extract/pcfg-common/numbered_set.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/pcfg.cc (renamed from scripts/training/phrase-extract/pcfg-common/pcfg.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/pcfg.h (renamed from scripts/training/phrase-extract/pcfg-common/pcfg.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/pcfg_tree.h (renamed from scripts/training/phrase-extract/pcfg-common/pcfg_tree.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/syntax_tree.h (renamed from scripts/training/phrase-extract/pcfg-common/syntax_tree.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/tool.cc (renamed from scripts/training/phrase-extract/pcfg-common/tool.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/tool.h (renamed from scripts/training/phrase-extract/pcfg-common/tool.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/typedef.h (renamed from scripts/training/phrase-extract/pcfg-common/typedef.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/xml_tree_parser.cc (renamed from scripts/training/phrase-extract/pcfg-common/xml_tree_parser.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/xml_tree_parser.h (renamed from scripts/training/phrase-extract/pcfg-common/xml_tree_parser.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-common/xml_tree_writer.h (renamed from scripts/training/phrase-extract/pcfg-common/xml_tree_writer.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/Jamfile | 1 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/main.cc (renamed from scripts/training/phrase-extract/pcfg-extract/main.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/options.h (renamed from scripts/training/phrase-extract/pcfg-extract/options.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/pcfg_extract.cc (renamed from scripts/training/phrase-extract/pcfg-extract/pcfg_extract.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/pcfg_extract.h (renamed from scripts/training/phrase-extract/pcfg-extract/pcfg_extract.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/rule_collection.cc (renamed from scripts/training/phrase-extract/pcfg-extract/rule_collection.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/rule_collection.h (renamed from scripts/training/phrase-extract/pcfg-extract/rule_collection.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/rule_extractor.cc (renamed from scripts/training/phrase-extract/pcfg-extract/rule_extractor.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-extract/rule_extractor.h (renamed from scripts/training/phrase-extract/pcfg-extract/rule_extractor.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/Jamfile | 1 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/main.cc (renamed from scripts/training/phrase-extract/pcfg-score/main.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/options.h (renamed from scripts/training/phrase-extract/pcfg-score/options.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/pcfg_score.cc (renamed from scripts/training/phrase-extract/pcfg-score/pcfg_score.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/pcfg_score.h (renamed from scripts/training/phrase-extract/pcfg-score/pcfg_score.h) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/tree_scorer.cc (renamed from scripts/training/phrase-extract/pcfg-score/tree_scorer.cc) | 0 | ||||
-rw-r--r-- | phrase-extract/pcfg-score/tree_scorer.h (renamed from scripts/training/phrase-extract/pcfg-score/tree_scorer.h) | 0 | ||||
-rw-r--r-- | phrase-extract/phrase-extract.sln (renamed from scripts/training/phrase-extract/phrase-extract.sln) | 0 | ||||
-rw-r--r-- | phrase-extract/relax-parse.cpp (renamed from scripts/training/phrase-extract/relax-parse.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/relax-parse.h (renamed from scripts/training/phrase-extract/relax-parse.h) | 0 | ||||
-rw-r--r-- | phrase-extract/score.cpp (renamed from scripts/training/phrase-extract/score.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/score.h (renamed from scripts/training/phrase-extract/score.h) | 0 | ||||
-rw-r--r-- | phrase-extract/score.vcxproj (renamed from scripts/training/phrase-extract/score.vcxproj) | 0 | ||||
-rw-r--r-- | phrase-extract/statistics.cpp (renamed from scripts/training/phrase-extract/statistics.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/tables-core.cpp (renamed from scripts/training/phrase-extract/tables-core.cpp) | 0 | ||||
-rw-r--r-- | phrase-extract/tables-core.h (renamed from scripts/training/phrase-extract/tables-core.h) | 0 | ||||
-rw-r--r-- | scripts/training/Jamfile | 5 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Compactify.cpp | 296 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Compactify.h | 43 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Compactify_Main.cpp | 6 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Exception.h | 22 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Jamfile | 3 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/NumberedSet.h | 79 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Options.h | 18 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/RuleTableParser.cpp | 168 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/RuleTableParser.h | 51 | ||||
-rw-r--r-- | scripts/training/compact-rule-table/Tool.h | 34 | ||||
-rw-r--r-- | scripts/training/phrase-extract/extract-ghkm/Jamfile | 1 | ||||
-rw-r--r-- | scripts/training/phrase-extract/pcfg-extract/Jamfile | 1 | ||||
-rw-r--r-- | scripts/training/phrase-extract/pcfg-score/Jamfile | 1 | ||||
-rw-r--r-- | symal/Jamfile (renamed from scripts/training/symal/Jamfile) | 0 | ||||
-rw-r--r-- | symal/cmd.c (renamed from scripts/training/symal/cmd.c) | 0 | ||||
-rw-r--r-- | symal/cmd.h (renamed from scripts/training/symal/cmd.h) | 0 | ||||
-rwxr-xr-x | symal/giza2bal.pl (renamed from scripts/training/symal/giza2bal.pl) | 0 | ||||
-rw-r--r-- | symal/symal.cpp (renamed from scripts/training/symal/symal.cpp) | 0 | ||||
-rw-r--r-- | symal/symal.vcproj (renamed from scripts/training/symal/symal.vcproj) | 0 |
126 files changed, 10 insertions, 735 deletions
@@ -104,7 +104,7 @@ build-project scripts ; #Regression tests (only does anything if --with-regtest is passed) build-project regression-testing ; -alias programs : lm//query lm//build_binary moses-chart-cmd/src//moses_chart moses-cmd/src//programs OnDiskPt//CreateOnDiskPt OnDiskPt//queryOnDiskPt mert//programs contrib/server//mosesserver misc//programs scripts//training//symal scripts//training//lexical-reordering scripts//training//phrase-extract scripts//training//phrase-extract//extract-ghkm scripts//training//phrase-extract//pcfg-extract scripts//training//phrase-extract//pcfg-score ; +alias programs : lm//query lm//build_binary moses-chart-cmd/src//moses_chart moses-cmd/src//programs OnDiskPt//CreateOnDiskPt OnDiskPt//queryOnDiskPt mert//programs contrib/server//mosesserver misc//programs symal scripts//training//lexical-reordering phrase-extract phrase-extract//extract-ghkm phrase-extract//pcfg-extract phrase-extract//pcfg-score ; install-bin-libs programs ; install-headers headers-base : [ glob-tree *.h *.hh : jam-files dist bin lib include kenlm moses ] : . ; diff --git a/scripts/training/phrase-extract/AlignmentPhrase.cpp b/phrase-extract/AlignmentPhrase.cpp index 2d4439567..2d4439567 100644 --- a/scripts/training/phrase-extract/AlignmentPhrase.cpp +++ b/phrase-extract/AlignmentPhrase.cpp diff --git a/scripts/training/phrase-extract/AlignmentPhrase.h b/phrase-extract/AlignmentPhrase.h index f77b44f36..f77b44f36 100644 --- a/scripts/training/phrase-extract/AlignmentPhrase.h +++ b/phrase-extract/AlignmentPhrase.h diff --git a/scripts/training/phrase-extract/ExtractedRule.cpp b/phrase-extract/ExtractedRule.cpp index c566e842a..c566e842a 100644 --- a/scripts/training/phrase-extract/ExtractedRule.cpp +++ b/phrase-extract/ExtractedRule.cpp diff --git a/scripts/training/phrase-extract/ExtractedRule.h b/phrase-extract/ExtractedRule.h index be6e30836..be6e30836 100644 --- a/scripts/training/phrase-extract/ExtractedRule.h +++ b/phrase-extract/ExtractedRule.h diff --git a/scripts/training/phrase-extract/Hole.h b/phrase-extract/Hole.h index 31e928f6e..31e928f6e 100644 --- a/scripts/training/phrase-extract/Hole.h +++ b/phrase-extract/Hole.h diff --git a/scripts/training/phrase-extract/HoleCollection.cpp b/phrase-extract/HoleCollection.cpp index 4cffab7fd..4cffab7fd 100644 --- a/scripts/training/phrase-extract/HoleCollection.cpp +++ b/phrase-extract/HoleCollection.cpp diff --git a/scripts/training/phrase-extract/HoleCollection.h b/phrase-extract/HoleCollection.h index 355e825fb..355e825fb 100644 --- a/scripts/training/phrase-extract/HoleCollection.h +++ b/phrase-extract/HoleCollection.h diff --git a/scripts/training/phrase-extract/InputFileStream.cpp b/phrase-extract/InputFileStream.cpp index d111903e6..d111903e6 100644 --- a/scripts/training/phrase-extract/InputFileStream.cpp +++ b/phrase-extract/InputFileStream.cpp diff --git a/scripts/training/phrase-extract/InputFileStream.h b/phrase-extract/InputFileStream.h index e2a31bc82..e2a31bc82 100644 --- a/scripts/training/phrase-extract/InputFileStream.h +++ b/phrase-extract/InputFileStream.h diff --git a/scripts/training/phrase-extract/Jamfile b/phrase-extract/Jamfile index 6fae90bb0..d834674b8 100644 --- a/scripts/training/phrase-extract/Jamfile +++ b/phrase-extract/Jamfile @@ -1,5 +1,5 @@ obj InputFileStream.o : InputFileStream.cpp : <include>. ; -alias InputFileStream : InputFileStream.o ../../..//z ; +alias InputFileStream : InputFileStream.o ..//z ; obj tables-core.o : tables-core.cpp : <include>. ; obj AlignmentPhrase.o : AlignmentPhrase.cpp : <include>. ; @@ -10,17 +10,17 @@ obj XmlTree.o : XmlTree.cpp : <include>. ; alias filestreams : InputFileStream.cpp OutputFileStream.cpp : : : <include>. ; alias trees : SyntaxTree.cpp tables-core.o XmlTree.o : : : <include>. ; -exe extract : tables-core.o SentenceAlignment.o extract.cpp OutputFileStream.cpp InputFileStream ../../..//boost_iostreams ; +exe extract : tables-core.o SentenceAlignment.o extract.cpp OutputFileStream.cpp InputFileStream ..//boost_iostreams ; -exe extract-rules : tables-core.o SentenceAlignment.o SyntaxTree.o XmlTree.o SentenceAlignmentWithSyntax.cpp HoleCollection.cpp extract-rules.cpp ExtractedRule.cpp OutputFileStream.cpp InputFileStream ../../../moses/src//ThreadPool ../../..//boost_iostreams ; +exe extract-rules : tables-core.o SentenceAlignment.o SyntaxTree.o XmlTree.o SentenceAlignmentWithSyntax.cpp HoleCollection.cpp extract-rules.cpp ExtractedRule.cpp OutputFileStream.cpp InputFileStream ../moses/src//ThreadPool ..//boost_iostreams ; exe extract-lex : extract-lex.cpp InputFileStream ; -exe score : tables-core.o AlignmentPhrase.o score.cpp PhraseAlignment.cpp OutputFileStream.cpp InputFileStream ../../..//boost_iostreams ; +exe score : tables-core.o AlignmentPhrase.o score.cpp PhraseAlignment.cpp OutputFileStream.cpp InputFileStream ..//boost_iostreams ; -exe consolidate : consolidate.cpp tables-core.o OutputFileStream.cpp InputFileStream ../../..//boost_iostreams ; +exe consolidate : consolidate.cpp tables-core.o OutputFileStream.cpp InputFileStream ..//boost_iostreams ; -exe consolidate-direct : consolidate-direct.cpp OutputFileStream.cpp InputFileStream ../../..//boost_iostreams ; +exe consolidate-direct : consolidate-direct.cpp OutputFileStream.cpp InputFileStream ..//boost_iostreams ; exe consolidate-reverse : consolidate-reverse.cpp tables-core.o InputFileStream ; diff --git a/scripts/training/phrase-extract/OutputFileStream.cpp b/phrase-extract/OutputFileStream.cpp index 2cad33bb9..2cad33bb9 100644 --- a/scripts/training/phrase-extract/OutputFileStream.cpp +++ b/phrase-extract/OutputFileStream.cpp diff --git a/scripts/training/phrase-extract/OutputFileStream.h b/phrase-extract/OutputFileStream.h index f52e36d76..f52e36d76 100644 --- a/scripts/training/phrase-extract/OutputFileStream.h +++ b/phrase-extract/OutputFileStream.h diff --git a/scripts/training/phrase-extract/PhraseAlignment.cpp b/phrase-extract/PhraseAlignment.cpp index ceb74f04c..ceb74f04c 100644 --- a/scripts/training/phrase-extract/PhraseAlignment.cpp +++ b/phrase-extract/PhraseAlignment.cpp diff --git a/scripts/training/phrase-extract/PhraseAlignment.h b/phrase-extract/PhraseAlignment.h index 8bd83503d..8bd83503d 100644 --- a/scripts/training/phrase-extract/PhraseAlignment.h +++ b/phrase-extract/PhraseAlignment.h diff --git a/scripts/training/phrase-extract/RuleExist.h b/phrase-extract/RuleExist.h index cf7fae3cd..cf7fae3cd 100644 --- a/scripts/training/phrase-extract/RuleExist.h +++ b/phrase-extract/RuleExist.h diff --git a/scripts/training/phrase-extract/RuleExtractionOptions.h b/phrase-extract/RuleExtractionOptions.h index 272af2c76..272af2c76 100644 --- a/scripts/training/phrase-extract/RuleExtractionOptions.h +++ b/phrase-extract/RuleExtractionOptions.h diff --git a/scripts/training/phrase-extract/SafeGetline.h b/phrase-extract/SafeGetline.h index 0e03b8468..0e03b8468 100644 --- a/scripts/training/phrase-extract/SafeGetline.h +++ b/phrase-extract/SafeGetline.h diff --git a/scripts/training/phrase-extract/SentenceAlignment.cpp b/phrase-extract/SentenceAlignment.cpp index 8b513cfb4..8b513cfb4 100644 --- a/scripts/training/phrase-extract/SentenceAlignment.cpp +++ b/phrase-extract/SentenceAlignment.cpp diff --git a/scripts/training/phrase-extract/SentenceAlignment.h b/phrase-extract/SentenceAlignment.h index df3987198..df3987198 100644 --- a/scripts/training/phrase-extract/SentenceAlignment.h +++ b/phrase-extract/SentenceAlignment.h diff --git a/scripts/training/phrase-extract/SentenceAlignmentWithSyntax.cpp b/phrase-extract/SentenceAlignmentWithSyntax.cpp index 06dc3919f..06dc3919f 100644 --- a/scripts/training/phrase-extract/SentenceAlignmentWithSyntax.cpp +++ b/phrase-extract/SentenceAlignmentWithSyntax.cpp diff --git a/scripts/training/phrase-extract/SentenceAlignmentWithSyntax.h b/phrase-extract/SentenceAlignmentWithSyntax.h index a2c164655..a2c164655 100644 --- a/scripts/training/phrase-extract/SentenceAlignmentWithSyntax.h +++ b/phrase-extract/SentenceAlignmentWithSyntax.h diff --git a/scripts/training/phrase-extract/SyntaxTree.cpp b/phrase-extract/SyntaxTree.cpp index f2783ffd2..f2783ffd2 100644 --- a/scripts/training/phrase-extract/SyntaxTree.cpp +++ b/phrase-extract/SyntaxTree.cpp diff --git a/scripts/training/phrase-extract/SyntaxTree.h b/phrase-extract/SyntaxTree.h index 17c106b49..17c106b49 100644 --- a/scripts/training/phrase-extract/SyntaxTree.h +++ b/phrase-extract/SyntaxTree.h diff --git a/scripts/training/phrase-extract/XmlException.h b/phrase-extract/XmlException.h index 15ee91f20..15ee91f20 100644 --- a/scripts/training/phrase-extract/XmlException.h +++ b/phrase-extract/XmlException.h diff --git a/scripts/training/phrase-extract/XmlTree.cpp b/phrase-extract/XmlTree.cpp index 29c0d94aa..29c0d94aa 100644 --- a/scripts/training/phrase-extract/XmlTree.cpp +++ b/phrase-extract/XmlTree.cpp diff --git a/scripts/training/phrase-extract/XmlTree.h b/phrase-extract/XmlTree.h index 7e6bbecea..7e6bbecea 100644 --- a/scripts/training/phrase-extract/XmlTree.h +++ b/phrase-extract/XmlTree.h diff --git a/scripts/training/phrase-extract/consolidate-direct.cpp b/phrase-extract/consolidate-direct.cpp index e7e68e977..e7e68e977 100644 --- a/scripts/training/phrase-extract/consolidate-direct.cpp +++ b/phrase-extract/consolidate-direct.cpp diff --git a/scripts/training/phrase-extract/consolidate-direct.vcxproj b/phrase-extract/consolidate-direct.vcxproj index a84d2cce6..a84d2cce6 100644 --- a/scripts/training/phrase-extract/consolidate-direct.vcxproj +++ b/phrase-extract/consolidate-direct.vcxproj diff --git a/scripts/training/phrase-extract/consolidate-reverse.cpp b/phrase-extract/consolidate-reverse.cpp index c86d870c8..c86d870c8 100644 --- a/scripts/training/phrase-extract/consolidate-reverse.cpp +++ b/phrase-extract/consolidate-reverse.cpp diff --git a/scripts/training/phrase-extract/consolidate.cpp b/phrase-extract/consolidate.cpp index 17aa11846..17aa11846 100644 --- a/scripts/training/phrase-extract/consolidate.cpp +++ b/phrase-extract/consolidate.cpp diff --git a/scripts/training/phrase-extract/consolidate.vcxproj b/phrase-extract/consolidate.vcxproj index 1e77a90f0..1e77a90f0 100644 --- a/scripts/training/phrase-extract/consolidate.vcxproj +++ b/phrase-extract/consolidate.vcxproj diff --git a/scripts/training/phrase-extract/extract-ghkm/Alignment.cpp b/phrase-extract/extract-ghkm/Alignment.cpp index fcd5e14e1..fcd5e14e1 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Alignment.cpp +++ b/phrase-extract/extract-ghkm/Alignment.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/Alignment.h b/phrase-extract/extract-ghkm/Alignment.h index bc42191e1..bc42191e1 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Alignment.h +++ b/phrase-extract/extract-ghkm/Alignment.h diff --git a/scripts/training/phrase-extract/extract-ghkm/AlignmentGraph.cpp b/phrase-extract/extract-ghkm/AlignmentGraph.cpp index 6bd32a13b..6bd32a13b 100644 --- a/scripts/training/phrase-extract/extract-ghkm/AlignmentGraph.cpp +++ b/phrase-extract/extract-ghkm/AlignmentGraph.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/AlignmentGraph.h b/phrase-extract/extract-ghkm/AlignmentGraph.h index 94948758a..94948758a 100644 --- a/scripts/training/phrase-extract/extract-ghkm/AlignmentGraph.h +++ b/phrase-extract/extract-ghkm/AlignmentGraph.h diff --git a/scripts/training/phrase-extract/extract-ghkm/ComposedRule.cpp b/phrase-extract/extract-ghkm/ComposedRule.cpp index 8bf3cfc72..8bf3cfc72 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ComposedRule.cpp +++ b/phrase-extract/extract-ghkm/ComposedRule.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/ComposedRule.h b/phrase-extract/extract-ghkm/ComposedRule.h index 65ce9ac70..65ce9ac70 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ComposedRule.h +++ b/phrase-extract/extract-ghkm/ComposedRule.h diff --git a/scripts/training/phrase-extract/extract-ghkm/Exception.h b/phrase-extract/extract-ghkm/Exception.h index 9928785f0..9928785f0 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Exception.h +++ b/phrase-extract/extract-ghkm/Exception.h diff --git a/scripts/training/phrase-extract/extract-ghkm/ExtractGHKM.cpp b/phrase-extract/extract-ghkm/ExtractGHKM.cpp index dae876116..dae876116 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ExtractGHKM.cpp +++ b/phrase-extract/extract-ghkm/ExtractGHKM.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/ExtractGHKM.h b/phrase-extract/extract-ghkm/ExtractGHKM.h index f16abc5f3..f16abc5f3 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ExtractGHKM.h +++ b/phrase-extract/extract-ghkm/ExtractGHKM.h diff --git a/phrase-extract/extract-ghkm/Jamfile b/phrase-extract/extract-ghkm/Jamfile new file mode 100644 index 000000000..1a81c5f87 --- /dev/null +++ b/phrase-extract/extract-ghkm/Jamfile @@ -0,0 +1 @@ +exe extract-ghkm : [ glob *.cpp ] ..//filestreams ..//trees ../..//boost_iostreams ../..//boost_program_options ../..//z ; diff --git a/scripts/training/phrase-extract/extract-ghkm/Main.cpp b/phrase-extract/extract-ghkm/Main.cpp index faf3230a6..faf3230a6 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Main.cpp +++ b/phrase-extract/extract-ghkm/Main.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/Node.cpp b/phrase-extract/extract-ghkm/Node.cpp index beb7470b8..beb7470b8 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Node.cpp +++ b/phrase-extract/extract-ghkm/Node.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/Node.h b/phrase-extract/extract-ghkm/Node.h index 775473362..775473362 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Node.h +++ b/phrase-extract/extract-ghkm/Node.h diff --git a/scripts/training/phrase-extract/extract-ghkm/Options.h b/phrase-extract/extract-ghkm/Options.h index 362fc95d2..362fc95d2 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Options.h +++ b/phrase-extract/extract-ghkm/Options.h diff --git a/scripts/training/phrase-extract/extract-ghkm/ParseTree.cpp b/phrase-extract/extract-ghkm/ParseTree.cpp index 052b8dee1..052b8dee1 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ParseTree.cpp +++ b/phrase-extract/extract-ghkm/ParseTree.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/ParseTree.h b/phrase-extract/extract-ghkm/ParseTree.h index 273e2e04e..273e2e04e 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ParseTree.h +++ b/phrase-extract/extract-ghkm/ParseTree.h diff --git a/scripts/training/phrase-extract/extract-ghkm/ScfgRule.cpp b/phrase-extract/extract-ghkm/ScfgRule.cpp index 5dc70052c..5dc70052c 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ScfgRule.cpp +++ b/phrase-extract/extract-ghkm/ScfgRule.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/ScfgRule.h b/phrase-extract/extract-ghkm/ScfgRule.h index 2405d8fa3..2405d8fa3 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ScfgRule.h +++ b/phrase-extract/extract-ghkm/ScfgRule.h diff --git a/scripts/training/phrase-extract/extract-ghkm/ScfgRuleWriter.cpp b/phrase-extract/extract-ghkm/ScfgRuleWriter.cpp index cd993d6e8..cd993d6e8 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ScfgRuleWriter.cpp +++ b/phrase-extract/extract-ghkm/ScfgRuleWriter.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/ScfgRuleWriter.h b/phrase-extract/extract-ghkm/ScfgRuleWriter.h index b92a432a1..b92a432a1 100644 --- a/scripts/training/phrase-extract/extract-ghkm/ScfgRuleWriter.h +++ b/phrase-extract/extract-ghkm/ScfgRuleWriter.h diff --git a/scripts/training/phrase-extract/extract-ghkm/Span.cpp b/phrase-extract/extract-ghkm/Span.cpp index f0eccbdf2..f0eccbdf2 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Span.cpp +++ b/phrase-extract/extract-ghkm/Span.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/Span.h b/phrase-extract/extract-ghkm/Span.h index 003d1ef84..003d1ef84 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Span.h +++ b/phrase-extract/extract-ghkm/Span.h diff --git a/scripts/training/phrase-extract/extract-ghkm/Subgraph.cpp b/phrase-extract/extract-ghkm/Subgraph.cpp index e048f2c55..e048f2c55 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Subgraph.cpp +++ b/phrase-extract/extract-ghkm/Subgraph.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/Subgraph.h b/phrase-extract/extract-ghkm/Subgraph.h index ede1233e9..ede1233e9 100644 --- a/scripts/training/phrase-extract/extract-ghkm/Subgraph.h +++ b/phrase-extract/extract-ghkm/Subgraph.h diff --git a/scripts/training/phrase-extract/extract-ghkm/XmlTreeParser.cpp b/phrase-extract/extract-ghkm/XmlTreeParser.cpp index cc961dc0c..cc961dc0c 100644 --- a/scripts/training/phrase-extract/extract-ghkm/XmlTreeParser.cpp +++ b/phrase-extract/extract-ghkm/XmlTreeParser.cpp diff --git a/scripts/training/phrase-extract/extract-ghkm/XmlTreeParser.h b/phrase-extract/extract-ghkm/XmlTreeParser.h index 664ab11a3..664ab11a3 100644 --- a/scripts/training/phrase-extract/extract-ghkm/XmlTreeParser.h +++ b/phrase-extract/extract-ghkm/XmlTreeParser.h diff --git a/scripts/training/phrase-extract/extract-lex.cpp b/phrase-extract/extract-lex.cpp index 9b03a6da0..9b03a6da0 100644 --- a/scripts/training/phrase-extract/extract-lex.cpp +++ b/phrase-extract/extract-lex.cpp diff --git a/scripts/training/phrase-extract/extract-lex.h b/phrase-extract/extract-lex.h index e2225ecbc..e2225ecbc 100644 --- a/scripts/training/phrase-extract/extract-lex.h +++ b/phrase-extract/extract-lex.h diff --git a/scripts/training/phrase-extract/extract-lex.vcxproj b/phrase-extract/extract-lex.vcxproj index a291d51aa..a291d51aa 100644 --- a/scripts/training/phrase-extract/extract-lex.vcxproj +++ b/phrase-extract/extract-lex.vcxproj diff --git a/scripts/training/phrase-extract/extract-rules.cpp b/phrase-extract/extract-rules.cpp index 997038224..997038224 100644 --- a/scripts/training/phrase-extract/extract-rules.cpp +++ b/phrase-extract/extract-rules.cpp diff --git a/scripts/training/phrase-extract/extract-rules.vcxproj b/phrase-extract/extract-rules.vcxproj index ecd36fe50..ecd36fe50 100644 --- a/scripts/training/phrase-extract/extract-rules.vcxproj +++ b/phrase-extract/extract-rules.vcxproj diff --git a/scripts/training/phrase-extract/extract.cpp b/phrase-extract/extract.cpp index 16b413da9..16b413da9 100644 --- a/scripts/training/phrase-extract/extract.cpp +++ b/phrase-extract/extract.cpp diff --git a/scripts/training/phrase-extract/extract.vcxproj b/phrase-extract/extract.vcxproj index 60a1128eb..60a1128eb 100644 --- a/scripts/training/phrase-extract/extract.vcxproj +++ b/phrase-extract/extract.vcxproj diff --git a/scripts/training/phrase-extract/extract.xcodeproj/project.pbxproj b/phrase-extract/extract.xcodeproj/project.pbxproj index 1e02493cb..1e02493cb 100644 --- a/scripts/training/phrase-extract/extract.xcodeproj/project.pbxproj +++ b/phrase-extract/extract.xcodeproj/project.pbxproj diff --git a/scripts/training/phrase-extract/gzfilebuf.h b/phrase-extract/gzfilebuf.h index b5b0ce87f..b5b0ce87f 100644 --- a/scripts/training/phrase-extract/gzfilebuf.h +++ b/phrase-extract/gzfilebuf.h diff --git a/scripts/training/phrase-extract/hierarchical.h b/phrase-extract/hierarchical.h index 61c899013..61c899013 100644 --- a/scripts/training/phrase-extract/hierarchical.h +++ b/phrase-extract/hierarchical.h diff --git a/scripts/training/phrase-extract/pcfg-common/Jamfile b/phrase-extract/pcfg-common/Jamfile index 3dc272a56..3dc272a56 100644 --- a/scripts/training/phrase-extract/pcfg-common/Jamfile +++ b/phrase-extract/pcfg-common/Jamfile diff --git a/scripts/training/phrase-extract/pcfg-common/exception.h b/phrase-extract/pcfg-common/exception.h index 3dbd59d0e..3dbd59d0e 100644 --- a/scripts/training/phrase-extract/pcfg-common/exception.h +++ b/phrase-extract/pcfg-common/exception.h diff --git a/scripts/training/phrase-extract/pcfg-common/numbered_set.h b/phrase-extract/pcfg-common/numbered_set.h index 15e768b4c..15e768b4c 100644 --- a/scripts/training/phrase-extract/pcfg-common/numbered_set.h +++ b/phrase-extract/pcfg-common/numbered_set.h diff --git a/scripts/training/phrase-extract/pcfg-common/pcfg.cc b/phrase-extract/pcfg-common/pcfg.cc index 054e20a48..054e20a48 100644 --- a/scripts/training/phrase-extract/pcfg-common/pcfg.cc +++ b/phrase-extract/pcfg-common/pcfg.cc diff --git a/scripts/training/phrase-extract/pcfg-common/pcfg.h b/phrase-extract/pcfg-common/pcfg.h index b87336584..b87336584 100644 --- a/scripts/training/phrase-extract/pcfg-common/pcfg.h +++ b/phrase-extract/pcfg-common/pcfg.h diff --git a/scripts/training/phrase-extract/pcfg-common/pcfg_tree.h b/phrase-extract/pcfg-common/pcfg_tree.h index bdac64dfc..bdac64dfc 100644 --- a/scripts/training/phrase-extract/pcfg-common/pcfg_tree.h +++ b/phrase-extract/pcfg-common/pcfg_tree.h diff --git a/scripts/training/phrase-extract/pcfg-common/syntax_tree.h b/phrase-extract/pcfg-common/syntax_tree.h index 89c6ec0c3..89c6ec0c3 100644 --- a/scripts/training/phrase-extract/pcfg-common/syntax_tree.h +++ b/phrase-extract/pcfg-common/syntax_tree.h diff --git a/scripts/training/phrase-extract/pcfg-common/tool.cc b/phrase-extract/pcfg-common/tool.cc index bebd220e1..bebd220e1 100644 --- a/scripts/training/phrase-extract/pcfg-common/tool.cc +++ b/phrase-extract/pcfg-common/tool.cc diff --git a/scripts/training/phrase-extract/pcfg-common/tool.h b/phrase-extract/pcfg-common/tool.h index 0af342569..0af342569 100644 --- a/scripts/training/phrase-extract/pcfg-common/tool.h +++ b/phrase-extract/pcfg-common/tool.h diff --git a/scripts/training/phrase-extract/pcfg-common/typedef.h b/phrase-extract/pcfg-common/typedef.h index 49a12d681..49a12d681 100644 --- a/scripts/training/phrase-extract/pcfg-common/typedef.h +++ b/phrase-extract/pcfg-common/typedef.h diff --git a/scripts/training/phrase-extract/pcfg-common/xml_tree_parser.cc b/phrase-extract/pcfg-common/xml_tree_parser.cc index fd9d11334..fd9d11334 100644 --- a/scripts/training/phrase-extract/pcfg-common/xml_tree_parser.cc +++ b/phrase-extract/pcfg-common/xml_tree_parser.cc diff --git a/scripts/training/phrase-extract/pcfg-common/xml_tree_parser.h b/phrase-extract/pcfg-common/xml_tree_parser.h index 6b418c44e..6b418c44e 100644 --- a/scripts/training/phrase-extract/pcfg-common/xml_tree_parser.h +++ b/phrase-extract/pcfg-common/xml_tree_parser.h diff --git a/scripts/training/phrase-extract/pcfg-common/xml_tree_writer.h b/phrase-extract/pcfg-common/xml_tree_writer.h index 6a9a3de05..6a9a3de05 100644 --- a/scripts/training/phrase-extract/pcfg-common/xml_tree_writer.h +++ b/phrase-extract/pcfg-common/xml_tree_writer.h diff --git a/phrase-extract/pcfg-extract/Jamfile b/phrase-extract/pcfg-extract/Jamfile new file mode 100644 index 000000000..fc93f1a19 --- /dev/null +++ b/phrase-extract/pcfg-extract/Jamfile @@ -0,0 +1 @@ +exe pcfg-extract : [ glob *.cc ] ..//pcfg-common ../..//boost_program_options ; diff --git a/scripts/training/phrase-extract/pcfg-extract/main.cc b/phrase-extract/pcfg-extract/main.cc index 47b45afc3..47b45afc3 100644 --- a/scripts/training/phrase-extract/pcfg-extract/main.cc +++ b/phrase-extract/pcfg-extract/main.cc diff --git a/scripts/training/phrase-extract/pcfg-extract/options.h b/phrase-extract/pcfg-extract/options.h index 3acb31b58..3acb31b58 100644 --- a/scripts/training/phrase-extract/pcfg-extract/options.h +++ b/phrase-extract/pcfg-extract/options.h diff --git a/scripts/training/phrase-extract/pcfg-extract/pcfg_extract.cc b/phrase-extract/pcfg-extract/pcfg_extract.cc index 71c2e31c3..71c2e31c3 100644 --- a/scripts/training/phrase-extract/pcfg-extract/pcfg_extract.cc +++ b/phrase-extract/pcfg-extract/pcfg_extract.cc diff --git a/scripts/training/phrase-extract/pcfg-extract/pcfg_extract.h b/phrase-extract/pcfg-extract/pcfg_extract.h index 1af6cb4fe..1af6cb4fe 100644 --- a/scripts/training/phrase-extract/pcfg-extract/pcfg_extract.h +++ b/phrase-extract/pcfg-extract/pcfg_extract.h diff --git a/scripts/training/phrase-extract/pcfg-extract/rule_collection.cc b/phrase-extract/pcfg-extract/rule_collection.cc index 32b63e0ef..32b63e0ef 100644 --- a/scripts/training/phrase-extract/pcfg-extract/rule_collection.cc +++ b/phrase-extract/pcfg-extract/rule_collection.cc diff --git a/scripts/training/phrase-extract/pcfg-extract/rule_collection.h b/phrase-extract/pcfg-extract/rule_collection.h index 452fa0e97..452fa0e97 100644 --- a/scripts/training/phrase-extract/pcfg-extract/rule_collection.h +++ b/phrase-extract/pcfg-extract/rule_collection.h diff --git a/scripts/training/phrase-extract/pcfg-extract/rule_extractor.cc b/phrase-extract/pcfg-extract/rule_extractor.cc index 217574e7d..217574e7d 100644 --- a/scripts/training/phrase-extract/pcfg-extract/rule_extractor.cc +++ b/phrase-extract/pcfg-extract/rule_extractor.cc diff --git a/scripts/training/phrase-extract/pcfg-extract/rule_extractor.h b/phrase-extract/pcfg-extract/rule_extractor.h index 6bcffbc61..6bcffbc61 100644 --- a/scripts/training/phrase-extract/pcfg-extract/rule_extractor.h +++ b/phrase-extract/pcfg-extract/rule_extractor.h diff --git a/phrase-extract/pcfg-score/Jamfile b/phrase-extract/pcfg-score/Jamfile new file mode 100644 index 000000000..6b8c963ce --- /dev/null +++ b/phrase-extract/pcfg-score/Jamfile @@ -0,0 +1 @@ +exe pcfg-score : [ glob *.cc ] ..//pcfg-common ../..//boost_program_options ; diff --git a/scripts/training/phrase-extract/pcfg-score/main.cc b/phrase-extract/pcfg-score/main.cc index da5392add..da5392add 100644 --- a/scripts/training/phrase-extract/pcfg-score/main.cc +++ b/phrase-extract/pcfg-score/main.cc diff --git a/scripts/training/phrase-extract/pcfg-score/options.h b/phrase-extract/pcfg-score/options.h index e54b2a0b9..e54b2a0b9 100644 --- a/scripts/training/phrase-extract/pcfg-score/options.h +++ b/phrase-extract/pcfg-score/options.h diff --git a/scripts/training/phrase-extract/pcfg-score/pcfg_score.cc b/phrase-extract/pcfg-score/pcfg_score.cc index 345d7fc60..345d7fc60 100644 --- a/scripts/training/phrase-extract/pcfg-score/pcfg_score.cc +++ b/phrase-extract/pcfg-score/pcfg_score.cc diff --git a/scripts/training/phrase-extract/pcfg-score/pcfg_score.h b/phrase-extract/pcfg-score/pcfg_score.h index 5e506c39d..5e506c39d 100644 --- a/scripts/training/phrase-extract/pcfg-score/pcfg_score.h +++ b/phrase-extract/pcfg-score/pcfg_score.h diff --git a/scripts/training/phrase-extract/pcfg-score/tree_scorer.cc b/phrase-extract/pcfg-score/tree_scorer.cc index f9ce97ae0..f9ce97ae0 100644 --- a/scripts/training/phrase-extract/pcfg-score/tree_scorer.cc +++ b/phrase-extract/pcfg-score/tree_scorer.cc diff --git a/scripts/training/phrase-extract/pcfg-score/tree_scorer.h b/phrase-extract/pcfg-score/tree_scorer.h index 36f4e1e99..36f4e1e99 100644 --- a/scripts/training/phrase-extract/pcfg-score/tree_scorer.h +++ b/phrase-extract/pcfg-score/tree_scorer.h diff --git a/scripts/training/phrase-extract/phrase-extract.sln b/phrase-extract/phrase-extract.sln index 800c26192..800c26192 100644 --- a/scripts/training/phrase-extract/phrase-extract.sln +++ b/phrase-extract/phrase-extract.sln diff --git a/scripts/training/phrase-extract/relax-parse.cpp b/phrase-extract/relax-parse.cpp index 6e561b921..6e561b921 100644 --- a/scripts/training/phrase-extract/relax-parse.cpp +++ b/phrase-extract/relax-parse.cpp diff --git a/scripts/training/phrase-extract/relax-parse.h b/phrase-extract/relax-parse.h index ae5994641..ae5994641 100644 --- a/scripts/training/phrase-extract/relax-parse.h +++ b/phrase-extract/relax-parse.h diff --git a/scripts/training/phrase-extract/score.cpp b/phrase-extract/score.cpp index 5e0ade627..5e0ade627 100644 --- a/scripts/training/phrase-extract/score.cpp +++ b/phrase-extract/score.cpp diff --git a/scripts/training/phrase-extract/score.h b/phrase-extract/score.h index 9faa144c5..9faa144c5 100644 --- a/scripts/training/phrase-extract/score.h +++ b/phrase-extract/score.h diff --git a/scripts/training/phrase-extract/score.vcxproj b/phrase-extract/score.vcxproj index e5dc1df9a..e5dc1df9a 100644 --- a/scripts/training/phrase-extract/score.vcxproj +++ b/phrase-extract/score.vcxproj diff --git a/scripts/training/phrase-extract/statistics.cpp b/phrase-extract/statistics.cpp index a39e98a5d..a39e98a5d 100644 --- a/scripts/training/phrase-extract/statistics.cpp +++ b/phrase-extract/statistics.cpp diff --git a/scripts/training/phrase-extract/tables-core.cpp b/phrase-extract/tables-core.cpp index 93ad8b6a1..93ad8b6a1 100644 --- a/scripts/training/phrase-extract/tables-core.cpp +++ b/phrase-extract/tables-core.cpp diff --git a/scripts/training/phrase-extract/tables-core.h b/phrase-extract/tables-core.h index 1899b4d77..1899b4d77 100644 --- a/scripts/training/phrase-extract/tables-core.h +++ b/phrase-extract/tables-core.h diff --git a/scripts/training/Jamfile b/scripts/training/Jamfile index 8ca408d07..e290bb0cb 100644 --- a/scripts/training/Jamfile +++ b/scripts/training/Jamfile @@ -1,8 +1,3 @@ -build-project compact-rule-table ; -build-project phrase-extract ; -build-project lexical-reordering ; -build-project symal ; - if $(WITH-GIZA) != no || $(CLEANING) != no { make train-model.perl : train-model.perl.missing_bin_dir : @missing_bin_dir ; actions missing_bin_dir { diff --git a/scripts/training/compact-rule-table/Compactify.cpp b/scripts/training/compact-rule-table/Compactify.cpp deleted file mode 100644 index ceb7eb090..000000000 --- a/scripts/training/compact-rule-table/Compactify.cpp +++ /dev/null @@ -1,296 +0,0 @@ -#include "Compactify.h" - -#include "NumberedSet.h" -#include "Options.h" -#include "RuleTableParser.h" - -#include <boost/algorithm/string.hpp> -#include <boost/program_options.hpp> -#include <boost/unordered_map.hpp> - -#include <cstdlib> -#include <fstream> -#include <iostream> -#include <set> -#include <sstream> - -namespace moses { - -int Compactify::main(int argc, char *argv[]) { - // Process the command-line arguments. - Options options; - processOptions(argc, argv, options); - - // Open the input stream. - std::istream *inputPtr; - std::ifstream inputFileStream; - if (options.inputFile.empty() || options.inputFile == "-") { - inputPtr = &(std::cin); - } else { - inputFileStream.open(options.inputFile.c_str()); - if (!inputFileStream) { - std::ostringstream msg; - msg << "failed to open input file: " << options.inputFile; - error(msg.str()); - } - inputPtr = &inputFileStream; - } - std::istream &input = *inputPtr; - - // Open the output stream. - std::ostream *outputPtr; - std::ofstream outputFileStream; - if (options.outputFile.empty()) { - outputPtr = &(std::cout); - } else { - outputFileStream.open(options.outputFile.c_str()); - if (!outputFileStream) { - std::ostringstream msg; - msg << "failed to open output file: " << options.outputFile; - error(msg.str()); - } - outputPtr = &outputFileStream; - } - std::ostream &output = *outputPtr; - - // Open a temporary file: the rule section must appear last in the output - // file, but we don't want to store the full set of rules in memory during - // processing, so instead they're written to a temporary file then copied to - // the output file as a final step. - std::fstream tempFileStream; - { - char fileNameTemplate[] = "/tmp/compact_XXXXXX"; - int fd = mkstemp(fileNameTemplate); - if (fd == -1) { - std::ostringstream msg; - msg << "failed to open temporary file with pattern " << fileNameTemplate; - error(msg.str()); - } - tempFileStream.open(fileNameTemplate); - if (!tempFileStream) { - std::ostringstream msg; - msg << "failed to open existing temporary file: " << fileNameTemplate; - error(msg.str()); - } - // Close the original file descriptor. - close(fd); - // Unlink the file. Its contents will be safe until tempFileStream is - // closed. - unlink(fileNameTemplate); - } - - // Write the version number - output << "1" << '\n'; - - SymbolSet symbolSet; - PhraseSet sourcePhraseSet; - PhraseSet targetPhraseSet; - AlignmentSetSet alignmentSetSet; - - SymbolPhrase symbolPhrase; - - size_t ruleCount = 0; - RuleTableParser end; - try { - for (RuleTableParser parser(input); parser != end; ++parser) { - const RuleTableParser::Entry &entry = *parser; - ++ruleCount; - - // Report progress in the same format as extract-rules. - if (ruleCount % 100000 == 0) { - std::cerr << "." << std::flush; - } - if (ruleCount % 1000000 == 0) { - std::cerr << " " << ruleCount << std::endl; - } - - // Encode the source LHS + RHS as a vector of symbol IDs and insert into - // sourcePhraseSet. - encodePhrase(entry.sourceLhs, entry.sourceRhs, symbolSet, symbolPhrase); - SymbolIDType sourceId = sourcePhraseSet.insert(symbolPhrase); - - // Encode the target LHS + RHS as a vector of symbol IDs and insert into - // targetPhraseSet. - encodePhrase(entry.targetLhs, entry.targetRhs, symbolSet, symbolPhrase); - SymbolIDType targetId = targetPhraseSet.insert(symbolPhrase); - - // Insert the alignments into alignmentSetSet. - AlignmentSetIDType alignmentSetId = alignmentSetSet.insert( - entry.alignments); - - // Write this rule to the temporary file. - tempFileStream << sourceId << " " << targetId << " " << alignmentSetId; - for (std::vector<std::string>::const_iterator p = entry.scores.begin(); - p != entry.scores.end(); ++p) { - tempFileStream << " " << *p; - } - tempFileStream << " :"; - for (std::vector<std::string>::const_iterator p = entry.counts.begin(); - p != entry.counts.end(); ++p) { - tempFileStream << " " << *p; - } - tempFileStream << '\n'; - } - } catch (Exception &e) { - std::ostringstream msg; - msg << "error processing line " << ruleCount+1 << ": " << e.getMsg(); - error(msg.str()); - } - - // Report the counts. - - if (ruleCount % 1000000 != 0) { - std::cerr << std::endl; - } - std::cerr << "Rule count: " << ruleCount << std::endl; - std::cerr << "Symbol count: " << symbolSet.size() << std::endl; - std::cerr << "Source phrase count: " << sourcePhraseSet.size() << std::endl; - std::cerr << "Target phrase count: " << targetPhraseSet.size() << std::endl; - std::cerr << "Alignment set count: " << alignmentSetSet.size() << std::endl; - - // Write the symbol vocabulary. - - output << symbolSet.size() << '\n'; - for (SymbolSet::const_iterator p = symbolSet.begin(); - p != symbolSet.end(); ++p) { - const std::string &str = **p; - output << str << '\n'; - } - - // Write the source phrases. - - output << sourcePhraseSet.size() << '\n'; - for (PhraseSet::const_iterator p = sourcePhraseSet.begin(); - p != sourcePhraseSet.end(); ++p) { - const SymbolPhrase &sourcePhrase = **p; - for (SymbolPhrase::const_iterator q = sourcePhrase.begin(); - q != sourcePhrase.end(); ++q) { - if (q != sourcePhrase.begin()) { - output << " "; - } - output << *q; - } - output << '\n'; - } - - // Write the target phrases. - - output << targetPhraseSet.size() << '\n'; - for (PhraseSet::const_iterator p = targetPhraseSet.begin(); - p != targetPhraseSet.end(); ++p) { - const SymbolPhrase &targetPhrase = **p; - for (SymbolPhrase::const_iterator q = targetPhrase.begin(); - q != targetPhrase.end(); ++q) { - if (q != targetPhrase.begin()) { - output << " "; - } - output << *q; - } - output << '\n'; - } - - // Write the alignment sets. - - output << alignmentSetSet.size() << '\n'; - for (AlignmentSetSet::const_iterator p = alignmentSetSet.begin(); - p != alignmentSetSet.end(); ++p) { - const AlignmentSet &alignmentSet = **p; - for (AlignmentSet::const_iterator q = alignmentSet.begin(); - q != alignmentSet.end(); ++q) { - if (q != alignmentSet.begin()) { - output << " "; - } - output << q->first << "-" << q->second; - } - output << '\n'; - } - - // Write the rule count. - output << ruleCount << '\n'; - - // Copy the rules from the temporary file. - tempFileStream.seekg(0); - std::string line; - while (std::getline(tempFileStream, line)) { - output << line << '\n'; - } - - return 0; -} - -void Compactify::processOptions(int argc, char *argv[], - Options &options) const { - namespace po = boost::program_options; - - std::ostringstream usageMsg; - usageMsg << "usage: " << getName() << " [OPTION]... [FILE]"; - - // Declare the command line options that are visible to the user. - std::string caption = usageMsg.str() + std::string("\n\nAllowed options"); - po::options_description visible(caption); - visible.add_options() - ("help", "print help message and exit") - ("output,o", po::value<std::string>(), - "write rule table to arg instead of standard output") - ; - - // Declare the command line options that are hidden from the user - // (these are used as positional options). - po::options_description hidden("Hidden options"); - hidden.add_options() - ("input", po::value<std::string>(), "input file") - ; - - // Compose the full set of command-line options. - po::options_description cmdLineOptions; - cmdLineOptions.add(visible).add(hidden); - - // Register the positional options. - po::positional_options_description p; - p.add("input", 1); - - // Process the command-line. - po::variables_map vm; - try { - po::store(po::command_line_parser(argc, argv). - options(cmdLineOptions).positional(p).run(), vm); - po::notify(vm); - } catch (const std::exception &e) { - std::ostringstream msg; - msg << e.what() << "\n\n" << visible; - error(msg.str()); - std::exit(1); - } - - if (vm.count("help")) { - std::cout << visible << std::endl; - std::exit(0); - } - - // Process positional options. - - if (vm.count("input")) { - options.inputFile = vm["input"].as<std::string>(); - } - - // Process remaining options. - - if (vm.count("output")) { - options.outputFile = vm["output"].as<std::string>(); - } -} - -void Compactify::encodePhrase(const std::string &lhs, const StringPhrase &rhs, - SymbolSet &symbolSet, SymbolPhrase &vec) const { - vec.clear(); - vec.reserve(rhs.size()+1); - SymbolIDType id = symbolSet.insert(lhs); - vec.push_back(id); - for (std::vector<std::string>::const_iterator p = rhs.begin(); - p != rhs.end(); ++p) { - SymbolIDType id = symbolSet.insert(*p); - vec.push_back(id); - } -} - -} // namespace moses diff --git a/scripts/training/compact-rule-table/Compactify.h b/scripts/training/compact-rule-table/Compactify.h deleted file mode 100644 index ef5c1d9ec..000000000 --- a/scripts/training/compact-rule-table/Compactify.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#ifndef COMPACTIFY_H_ -#define COMPACTIFY_H_ - -#include "NumberedSet.h" -#include "Tool.h" - -#include <set> -#include <vector> - -namespace moses { - -struct Options; - -// Tool for converting a rule table into a more compact format. -class Compactify : public Tool { - public: - Compactify() : Tool("compactify") {} - virtual int main(int, char *[]); - private: - typedef unsigned int SymbolIDType; - typedef unsigned int PhraseIDType; - typedef unsigned int AlignmentSetIDType; - typedef std::vector<std::string> StringPhrase; - typedef std::vector<SymbolIDType> SymbolPhrase; - typedef std::pair<int, int> AlignmentPair; - typedef std::set<AlignmentPair> AlignmentSet; - typedef NumberedSet<std::string, SymbolIDType> SymbolSet; - typedef NumberedSet<SymbolPhrase, PhraseIDType> PhraseSet; - typedef NumberedSet<AlignmentSet, AlignmentSetIDType> AlignmentSetSet; - - void processOptions(int, char *[], Options &) const; - - // Given the string representations of a source or target LHS and RHS, encode - // the symbols using the given SymbolSet and create a SymbolPhrase object. - // The LHS index is the first element of the SymbolPhrase. - void encodePhrase(const std::string &, const StringPhrase &, - SymbolSet &, SymbolPhrase &) const; -}; - -} // namespace moses - -#endif diff --git a/scripts/training/compact-rule-table/Compactify_Main.cpp b/scripts/training/compact-rule-table/Compactify_Main.cpp deleted file mode 100644 index 5ae8833c1..000000000 --- a/scripts/training/compact-rule-table/Compactify_Main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "Compactify.h" - -int main(int argc, char *argv[]) { - moses::Compactify tool; - return tool.main(argc, argv); -} diff --git a/scripts/training/compact-rule-table/Exception.h b/scripts/training/compact-rule-table/Exception.h deleted file mode 100644 index 3868fcec5..000000000 --- a/scripts/training/compact-rule-table/Exception.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#ifndef EXCEPTION_H_ -#define EXCEPTION_H_ - -#include <string> - -namespace moses { - -class Exception { - public: - Exception(const char *msg) : m_msg(msg) {} - Exception(const std::string &msg) : m_msg(msg) {} - - const std::string &getMsg() const { return m_msg; } - - private: - std::string m_msg; -}; - -} // namespace moses - -#endif diff --git a/scripts/training/compact-rule-table/Jamfile b/scripts/training/compact-rule-table/Jamfile deleted file mode 100644 index 09f45d454..000000000 --- a/scripts/training/compact-rule-table/Jamfile +++ /dev/null @@ -1,3 +0,0 @@ -exe compactify : [ glob *.cpp ] ../../..//boost_program_options ; - -install tools : compactify : <install-type>EXE ; diff --git a/scripts/training/compact-rule-table/NumberedSet.h b/scripts/training/compact-rule-table/NumberedSet.h deleted file mode 100644 index 72c01cb30..000000000 --- a/scripts/training/compact-rule-table/NumberedSet.h +++ /dev/null @@ -1,79 +0,0 @@ -#pragma once -#ifndef NUMBEREDSET_H_ -#define NUMBEREDSET_H_ - -#include "Exception.h" - -#include <boost/unordered_map.hpp> - -#include <limits> -#include <sstream> -#include <vector> - -namespace moses { - -// Stores a set of elements of type T, each of which is allocated an integral -// ID of type IdType. IDs are contiguous starting at 0. Elements cannot be -// removed. -template<typename T, typename IdType=size_t> -class NumberedSet { - private: - typedef boost::unordered_map<T, IdType> ElementToIdMap; - typedef std::vector<const T *> IdToElementMap; - - public: - typedef typename IdToElementMap::const_iterator const_iterator; - - NumberedSet() {} - - const_iterator begin() const { return m_idToElement.begin(); } - const_iterator end() const { return m_idToElement.end(); } - - // Static value - static IdType nullID() { return std::numeric_limits<IdType>::max(); } - - bool empty() const { return m_idToElement.empty(); } - size_t size() const { return m_idToElement.size(); } - - IdType lookup(const T &) const; - const T &lookup(IdType) const; - - // Insert the given object and return its ID. - IdType insert(const T &); - - private: - ElementToIdMap m_elementToId; - IdToElementMap m_idToElement; -}; - -template<typename T, typename IdType> -IdType NumberedSet<T, IdType>::lookup(const T &s) const { - typename ElementToIdMap::const_iterator p = m_elementToId.find(s); - return (p == m_elementToId.end()) ? nullID() : p->second; -} - -template<typename T, typename IdType> -const T &NumberedSet<T, IdType>::lookup(IdType id) const { - if (id < 0 || id >= m_idToElement.size()) { - std::ostringstream msg; - msg << "Value not found: " << id; - throw Exception(msg.str()); - } - return *(m_idToElement[id]); -} - -template<typename T, typename IdType> -IdType NumberedSet<T, IdType>::insert(const T &x) { - std::pair<T, IdType> value(x, m_idToElement.size()); - std::pair<typename ElementToIdMap::iterator, bool> result = - m_elementToId.insert(value); - if (result.second) { - // x is a new element. - m_idToElement.push_back(&result.first->first); - } - return result.first->second; -} - -} // namespace moses - -#endif diff --git a/scripts/training/compact-rule-table/Options.h b/scripts/training/compact-rule-table/Options.h deleted file mode 100644 index f3fdb9139..000000000 --- a/scripts/training/compact-rule-table/Options.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -#ifndef OPTIONS_H_ -#define OPTIONS_H_ - -#include <string> - -namespace moses { - -struct Options { - public: - Options() {} - std::string inputFile; - std::string outputFile; -}; - -} // namespace moses - -#endif diff --git a/scripts/training/compact-rule-table/RuleTableParser.cpp b/scripts/training/compact-rule-table/RuleTableParser.cpp deleted file mode 100644 index 6272079fd..000000000 --- a/scripts/training/compact-rule-table/RuleTableParser.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include "RuleTableParser.h" - -#include "Exception.h" - -#include <boost/algorithm/string.hpp> -#include <boost/lexical_cast.hpp> - -#include <iostream> - -#include <istream> -#include <string> - -namespace moses { - -RuleTableParser::RuleTableParser() - : m_input(0) { -} - -RuleTableParser::RuleTableParser(std::istream &input) - : m_input(&input) { - ++(*this); -} - -RuleTableParser & RuleTableParser::operator++() { - if (!m_input) { - return *this; - } - if (!std::getline(*m_input, m_line)) { - m_input = 0; - return *this; - } - parseLine(m_line); - return *this; -} - -RuleTableParser RuleTableParser::operator++(int) { - RuleTableParser tmp(*this); - ++(*this); - return tmp; -} - -void RuleTableParser::parseLine(const std::string &line) { - // Source symbols - size_t pos = line.find("|||"); - if (pos == std::string::npos) { - throw Exception("missing first delimiter"); - } - std::string text = line.substr(0, pos); - boost::trim(text); - m_value.sourceRhs.clear(); - boost::split(m_value.sourceRhs, text, boost::algorithm::is_space(), - boost::algorithm::token_compress_on); - m_value.sourceLhs = m_value.sourceRhs.back(); - m_value.sourceRhs.pop_back(); - std::for_each(m_value.sourceRhs.begin(), m_value.sourceRhs.end(), - trimPairedSymbolFromRight); - - // Target symbols - size_t begin = pos+3; - pos = line.find("|||", begin); - if (pos == std::string::npos) { - throw Exception("missing second delimiter"); - } - text = line.substr(begin, pos-begin); - boost::trim(text); - m_value.targetRhs.clear(); - boost::split(m_value.targetRhs, text, boost::algorithm::is_space(), - boost::algorithm::token_compress_on); - m_value.targetLhs = m_value.targetRhs.back(); - m_value.targetRhs.pop_back(); - std::for_each(m_value.targetRhs.begin(), m_value.targetRhs.end(), - trimPairedSymbolFromLeft); - - // Scores - begin = pos+3; - pos = line.find("|||", begin); - if (pos == std::string::npos) { - throw Exception("missing third delimiter"); - } - text = line.substr(begin, pos-begin); - boost::trim(text); - m_value.scores.clear(); - boost::split(m_value.scores, text, boost::algorithm::is_space(), - boost::algorithm::token_compress_on); - - // Alignments - begin = pos+3; - pos = line.find("|||", begin); - if (pos == std::string::npos) { - throw Exception("missing fourth delimiter"); - } - text = line.substr(begin, pos-begin); - m_value.alignments.clear(); - boost::trim(text); - // boost::split behaves differently between versions on empry strings - if (!text.empty()) { - tmpStringVec.clear(); - boost::split(tmpStringVec, text, boost::algorithm::is_space(), - boost::algorithm::token_compress_on); - for (std::vector<std::string>::const_iterator p = tmpStringVec.begin(); - p != tmpStringVec.end(); ++p) { - assert(!p->empty()); - std::vector<std::string> tmpVec; - tmpVec.reserve(2); - boost::split(tmpVec, *p, boost::algorithm::is_any_of("-")); - if (tmpVec.size() != 2) { - throw Exception("bad alignment pair"); - } - std::pair<int, int> alignmentPair; - alignmentPair.first = boost::lexical_cast<int>(tmpVec[0]); - alignmentPair.second = boost::lexical_cast<int>(tmpVec[1]); - m_value.alignments.insert(alignmentPair); - } - } - - // Counts + everything else (the 'tail') - begin = pos+3; - pos = line.find("|||", begin); - if (pos == std::string::npos) { - text = line.substr(begin); - m_value.tail.clear(); - } else { - text = line.substr(begin, pos-begin); - m_value.tail = line.substr(pos+3); - } - boost::trim(text); - m_value.counts.clear(); - boost::split(m_value.counts, text, boost::algorithm::is_space(), - boost::algorithm::token_compress_on); -} - -void RuleTableParser::trimPairedSymbolFromLeft(std::string &s) { - size_t len = s.size(); - if (len < 2 || s[0] != '[' || s[len-1] != ']') { - return; - } - size_t pos = s.find('[', 1); - if (pos == std::string::npos) { - std::ostringstream msg; - msg << "malformed non-terminal pair: " << s; - throw Exception(msg.str()); - } - s.erase(0, pos); -} - -void RuleTableParser::trimPairedSymbolFromRight(std::string &s) { - size_t len = s.size(); - if (len < 2 || s[0] != '[' || s[len-1] != ']') { - return; - } - size_t pos = s.find('[', 1); - if (pos == std::string::npos) { - std::ostringstream msg; - msg << "malformed non-terminal pair: " << s; - throw Exception(msg.str()); - } - s.resize(pos); -} - -bool operator==(const RuleTableParser &lhs, const RuleTableParser &rhs) { - return lhs.m_input == rhs.m_input; -} - -bool operator!=(const RuleTableParser &lhs, const RuleTableParser &rhs) { - return !(lhs == rhs); -} - -} // namespace moses diff --git a/scripts/training/compact-rule-table/RuleTableParser.h b/scripts/training/compact-rule-table/RuleTableParser.h deleted file mode 100644 index 5599e63de..000000000 --- a/scripts/training/compact-rule-table/RuleTableParser.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once -#ifndef RULETABLEPARSER_H_INCLUDED_ -#define RULETABLEPARSER_H_INCLUDED_ - -#include <istream> -#include <set> -#include <string> -#include <utility> -#include <vector> - -namespace moses { - -class RuleTableParser { - public: - struct Entry { - std::string sourceLhs; - std::vector<std::string> sourceRhs; - std::string targetLhs; - std::vector<std::string> targetRhs; - std::vector<std::string> scores; - std::set<std::pair<int, int> > alignments; - std::vector<std::string> counts; - std::string tail; - }; - - RuleTableParser(); - RuleTableParser(std::istream &); - - const Entry &operator*() const { return m_value; } - const Entry *operator->() const { return &m_value; } - - RuleTableParser &operator++(); - RuleTableParser operator++(int); - - friend bool operator==(const RuleTableParser &, const RuleTableParser &); - friend bool operator!=(const RuleTableParser &, const RuleTableParser &); - - private: - Entry m_value; - std::istream *m_input; - std::string m_line; - std::vector<std::string> tmpStringVec; - - void parseLine(const std::string &); - static void trimPairedSymbolFromLeft(std::string &); - static void trimPairedSymbolFromRight(std::string &); -}; - -} // namespace moses - -#endif diff --git a/scripts/training/compact-rule-table/Tool.h b/scripts/training/compact-rule-table/Tool.h deleted file mode 100644 index 4a7e1e0e1..000000000 --- a/scripts/training/compact-rule-table/Tool.h +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once -#ifndef TOOL_H_ -#define TOOL_H_ - -#include <cstdlib> -#include <iostream> -#include <string> - -namespace moses { - -class Tool { - public: - Tool(const std::string &name) : m_name(name) {} - - const std::string &getName() const { return m_name; } - - virtual int main(int argc, char *argv[]) = 0; - - void warn(const std::string &msg) const { - std::cerr << m_name << ": warning: " << msg << std::endl; - } - - void error(const std::string &msg) const { - std::cerr << m_name << ": error: " << msg << std::endl; - std::exit(1); - } - - private: - std::string m_name; -}; - -} // namespace moses - -#endif diff --git a/scripts/training/phrase-extract/extract-ghkm/Jamfile b/scripts/training/phrase-extract/extract-ghkm/Jamfile deleted file mode 100644 index 92adc2126..000000000 --- a/scripts/training/phrase-extract/extract-ghkm/Jamfile +++ /dev/null @@ -1 +0,0 @@ -exe extract-ghkm : [ glob *.cpp ] ..//filestreams ..//trees ../../../..//boost_iostreams ../../../..//boost_program_options ../../../..//z ; diff --git a/scripts/training/phrase-extract/pcfg-extract/Jamfile b/scripts/training/phrase-extract/pcfg-extract/Jamfile deleted file mode 100644 index be91d6d2f..000000000 --- a/scripts/training/phrase-extract/pcfg-extract/Jamfile +++ /dev/null @@ -1 +0,0 @@ -exe pcfg-extract : [ glob *.cc ] ..//pcfg-common ../../../..//boost_program_options ; diff --git a/scripts/training/phrase-extract/pcfg-score/Jamfile b/scripts/training/phrase-extract/pcfg-score/Jamfile deleted file mode 100644 index 7225381c0..000000000 --- a/scripts/training/phrase-extract/pcfg-score/Jamfile +++ /dev/null @@ -1 +0,0 @@ -exe pcfg-score : [ glob *.cc ] ..//pcfg-common ../../../..//boost_program_options ; diff --git a/scripts/training/symal/Jamfile b/symal/Jamfile index 3ab564790..3ab564790 100644 --- a/scripts/training/symal/Jamfile +++ b/symal/Jamfile diff --git a/scripts/training/symal/cmd.c b/symal/cmd.c index 149fc7290..149fc7290 100644 --- a/scripts/training/symal/cmd.c +++ b/symal/cmd.c diff --git a/scripts/training/symal/cmd.h b/symal/cmd.h index 01a00abc0..01a00abc0 100644 --- a/scripts/training/symal/cmd.h +++ b/symal/cmd.h diff --git a/scripts/training/symal/giza2bal.pl b/symal/giza2bal.pl index 553ff2b3e..553ff2b3e 100755 --- a/scripts/training/symal/giza2bal.pl +++ b/symal/giza2bal.pl diff --git a/scripts/training/symal/symal.cpp b/symal/symal.cpp index da386d973..da386d973 100644 --- a/scripts/training/symal/symal.cpp +++ b/symal/symal.cpp diff --git a/scripts/training/symal/symal.vcproj b/symal/symal.vcproj index 6eac62f4a..6eac62f4a 100644 --- a/scripts/training/symal/symal.vcproj +++ b/symal/symal.vcproj |