From d5ccf5bc94f02ffa8bc968050ef5a839d2aeeafe Mon Sep 17 00:00:00 2001 From: dowobeha Date: Thu, 23 Aug 2012 17:51:28 +0000 Subject: Added flags to plain2snt to explicitly specify output files. The new flags are: -vcb1 -vcb2 -snt1 -snt2 --- mgizapp/src/plain2snt.cpp | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) (limited to 'mgizapp') diff --git a/mgizapp/src/plain2snt.cpp b/mgizapp/src/plain2snt.cpp index a6ee2e7..2aae066 100644 --- a/mgizapp/src/plain2snt.cpp +++ b/mgizapp/src/plain2snt.cpp @@ -11,17 +11,26 @@ using namespace std; int main(int argc,char**argv) { + string snt1(""), snt2(""), vcb1(""), vcb2(""); vectorweights; vectorfilenames; for(int i=1;i=vocab2.length() ) slashpos=0; string vocab2x(vocab2.substr(slashpos,vocab2.length())); - cout << vocab2 << " -> " << vocab2x << endl; - snt1=vocab1+"_"+vocab2x+string(".snt"); - snt2=vocab2+"_"+vocab1x+string(".snt"); - vocab1+=string(".vcb"); - vocab2+=string(".vcb"); + cout << vocab2 << " -> " << vocab2x << endl; + if (snt1=="") { + snt1=vocab1+"_"+vocab2x+string(".snt"); + } + if (snt2=="") { + snt2=vocab2+"_"+vocab1x+string(".snt"); + } + if (vcb1=="") { + vocab1+=string(".vcb"); + } else { + vocab1=vcb1; + } + if (vcb2=="") { + vocab2+=string(".vcb"); + } else { + vocab2=vcb2; + } ofstream ovocab1(vocab1.c_str()),ovocab2(vocab2.c_str()),osnt1(snt1.c_str()),osnt2(snt2.c_str()); for(unsigned int i=0;i