// -*- c++ -*- // test program for dynamic tsas #include #include #include #include #include #include #include #include #include #include #include #include #include #include "ug_conll_record.h" #include "tpt_tokenindex.h" #include "ug_mm_ttrack.h" #include "tpt_pickler.h" #include "ug_deptree.h" #include "moses/TranslationModel/UG/generic/sorting/VectorIndexSorter.h" #include "ug_im_ttrack.h" #include "ug_bitext.h" using namespace std; using namespace ugdiss; using namespace Moses; using namespace boost; using namespace Moses::bitext; namespace po=boost::program_options; typedef L2R_Token L2R; int main() { sptr > bt(new imBitext()); string s1,s2,aln; vector S1,S2,ALN; while (getline(cin,s1) && getline(cin,s2) && getline(cin,aln)) { S1.push_back(s1); S2.push_back(s2); ALN.push_back(aln); } bt = bt->add(S1,S2,ALN); TSA::tree_iterator m(bt->I2.get()); m.down(); do { char const* p = m.lower_bound(-1); tsa::ArrayEntry I(p); do { m.root->readEntry(I.next,I); L2R const* stop = m.root->getCorpus()->sntEnd(I.sid); for (L2R const* t = m.root->getCorpus()->getToken(I); t < stop; ++t) cout << (*bt->V2)[t->id()] << " "; cout << endl; } while (I.next < m.upper_bound(-1)); } while (m.over()); }