00001
00002
00003
00004 #include <boost/program_options.hpp>
00005 #include <boost/program_options/options_description.hpp>
00006 #include <boost/program_options/parsers.hpp>
00007 #include <boost/program_options/variables_map.hpp>
00008 #include <boost/iostreams/device/mapped_file.hpp>
00009
00010 #include <iostream>
00011 #include <fstream>
00012 #include <sstream>
00013 #include <iomanip>
00014 #include <vector>
00015 #include <string>
00016
00017 #include <sys/types.h>
00018 #include <sys/wait.h>
00019
00020 #include "ug_conll_record.h"
00021 #include "tpt_tokenindex.h"
00022 #include "ug_mm_ttrack.h"
00023 #include "tpt_pickler.h"
00024 #include "ug_deptree.h"
00025 #include "moses/TranslationModel/UG/generic/sorting/VectorIndexSorter.h"
00026 #include "ug_im_ttrack.h"
00027 #include "ug_bitext.h"
00028
00029 using namespace std;
00030 using namespace ugdiss;
00031 using namespace Moses;
00032 using namespace boost;
00033 using namespace Moses::bitext;
00034 namespace po=boost::program_options;
00035
00036 typedef L2R_Token<SimpleWordId> L2R;
00037
00038 int main()
00039 {
00040 SPTR<imBitext<L2R> > bt(new imBitext<L2R>());
00041 string s1,s2,aln;
00042 vector<string> S1,S2,ALN;
00043 while (getline(cin,s1) && getline(cin,s2) && getline(cin,aln))
00044 {
00045 S1.push_back(s1);
00046 S2.push_back(s2);
00047 ALN.push_back(aln);
00048 }
00049 bt = bt->add(S1,S2,ALN);
00050
00051 TSA<L2R>::tree_iterator m(bt->I2.get());
00052 m.down();
00053 do {
00054 char const* p = m.lower_bound(-1);
00055 tsa::ArrayEntry I(p);
00056 do {
00057 m.root->readEntry(I.next,I);
00058 L2R const* stop = m.root->getCorpus()->sntEnd(I.sid);
00059 for (L2R const* t = m.root->getCorpus()->getToken(I); t < stop; ++t)
00060 cout << (*bt->V2)[t->id()] << " ";
00061 cout << endl;
00062 } while (I.next < m.upper_bound(-1));
00063 } while (m.over());
00064 }