00001
00002
00003
00010 #include "../mm/tpt_tokenindex.h"
00011 #include <iostream>
00012 #include <iomanip>
00013
00014 using namespace std;
00015 using namespace sapt;
00016 int
00017 main(int argc,char* argv[])
00018 {
00019 if (argc > 1 && !strcmp(argv[1], "-h")) {
00020 printf("Usage: %s <file>\n\n", argv[0]);
00021 cout << "Converts a phrase table in text format to a phrase table in tighly packed format." << endl;
00022 cout << "input file: token index file" << endl;
00023 exit(1);
00024 }
00025
00026 TokenIndex I;
00027 I.open(argv[1]);
00028 vector<char const*> foo = I.reverseIndex();
00029 for (size_t i = 0; i < foo.size(); i++)
00030 cout << setw(10) << i << " " << foo[i] << endl;
00031 }