1 // -*- tab-width: 2 -*-
11 #include <boost/format.hpp>
15 int main(int argc
,char **argv
)
18 fprintf(stderr
,"Need at least 2 argument.\n");
22 char *oldres
= argv
[1];
23 char *newres
= argv
[2];
30 cerr
<< "Loading... ";
33 cerr
<< "done" << endl
;
35 get_sarch().set_blocked(true);
38 int i
,ii
,iii
,n
,nn
,nnn
,z
;
40 NgramStats
syllable_stats(get_sarch().get_dict(),2);
41 while (getline(cin
,s
)) {
44 cerr
<< count
<< endl
;
48 sentences_split(s
,ss
);
49 for (z
= 0;z
< ss
.size();z
++) {
53 if (!st
.get_syllable_count())
57 n
= st
.get_syllable_count();
58 vi
= new VocabIndex
[n
+1];
60 for (i
= 0;i
< n
;i
++)
61 vi
[i
] = get_sarch().in_dict(st
[i
].get_cid()) ? st
[i
].get_cid() : get_id(UNK_ID
);
62 syllable_stats
.countSentence(vi
);
67 cerr
<< "Calculating... ";
68 get_syngram().estimate(syllable_stats
);
70 str
= (boost::format("syngram.%s") % newres
).str().c_str();
72 get_syngram().write(fff
);