diff --git a/misc/Jamfile b/misc/Jamfile index 7fdf2b875..7e103e5d3 100644 --- a/misc/Jamfile +++ b/misc/Jamfile @@ -10,10 +10,10 @@ local with-cmph = [ option.get "with-cmph" ] ; if $(with-cmph) { exe processPhraseTableMin : processPhraseTableMin.cpp ../moses/src//moses ; exe processLexicalTableMin : processLexicalTableMin.cpp ../moses/src//moses ; -# exe queryPhraseTableMin : queryPhraseTableMin.cpp ../moses/src//moses ; + exe queryPhraseTableMin : queryPhraseTableMin.cpp ../moses/src//moses ; -# alias programsMin : processPhraseTableMin processLexicalTableMin queryPhraseTableMin ; - alias programsMin : processPhraseTableMin processLexicalTableMin ; + alias programsMin : processPhraseTableMin processLexicalTableMin queryPhraseTableMin ; +# alias programsMin : processPhraseTableMin processLexicalTableMin ; } else { alias programsMin ; diff --git a/scripts/fuzzy-match/compile.sh b/scripts/fuzzy-match/compile.sh new file mode 100755 index 000000000..61f82699b --- /dev/null +++ b/scripts/fuzzy-match/compile.sh @@ -0,0 +1,2 @@ +g++ -I ../../moses/src/ -I ../../ create_xml.cpp + diff --git a/scripts/fuzzy-match/create_xml.cpp b/scripts/fuzzy-match/create_xml.cpp new file mode 100644 index 000000000..f4ae5f3f5 --- /dev/null +++ b/scripts/fuzzy-match/create_xml.cpp @@ -0,0 +1,93 @@ + +#include +#include +#include +#include +#include +#include "Util.h" + +using namespace std; +using namespace Moses; + +void createXML(); + +int main(int argc, char **argv) +{ + assert(argc == 2); + + string inPath(argv[1]); + + ifstream inStrme(inPath.c_str()); + ofstream rule((inPath + ".extract").c_str()); + ofstream ruleInv((inPath + ".extract.inv").c_str()); + + int setenceId; + float score; + string source; + string *input = NULL; + vector targets, alignments, paths; + vector counts; + + string inLine; + + int step = 0; + while (!inStrme.eof()) + { + getline(inStrme, inLine); + cout << inLine << endl; + switch (step) + { + case 0: + setenceId = Scan(inLine); + ++step; + break; + case 1: + score = Scan(inLine); + ++step; + break; + case 2: + source = inLine; + ++step; + break; + case 3: + if (input == NULL) { + input = new string(inLine); + } + else { + assert(inLine == *input); + } + ++step; + break; + case 4: + targets.push_back(inLine); + ++step; + break; + case 5: + alignments.push_back(inLine); + ++step; + break; + case 6: + paths.push_back(inLine); + ++step; + break; + case 7: + counts.push_back(Scan(inLine)); + ++step; + break; + + } + + createXML(); + } + + delete input; + ruleInv.close(); + rule.close(); + inStrme.close(); + +} + +void createXML() +{ + +}