| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/slmbuild/ |
| slmbuild.cpp | 63 {"ngram", 1, 0, 'n'}, 84 -n --ngram N # 1 for unigram, 2 for bigram, 3 for trigram...\n\ 93 GT,R,dis : GT discount for r <= R, r is the freq of a ngram.\n\ 233 TSIMWordId * ngram = new TSIMWordId[N+1]; local 239 while (fread(ngram, sizeof(TSIMWordId), N, fp) == N && fread(&freq, sizeof(freq), 1, fp)==1) { 240 builder.AddNGram(ngram, freq); 244 delete ngram;
|
| /nv-g11n/inputmethod/sunpinyin2/src/slm/slmbuild/ |
| slmbuild.cpp | 63 {"ngram", 1, 0, 'n'}, 84 -n --ngram N # 1 for unigram, 2 for bigram, 3 for trigram...\n\ 93 GT,R,dis : GT discount for r <= R, r is the freq of a ngram.\n\ 233 TSIMWordId * ngram = new TSIMWordId[N+1]; local 239 while (fread(ngram, sizeof(TSIMWordId), N, fp) == N && fread(&freq, sizeof(freq), 1, fp)==1) { 240 builder.AddNGram(ngram, freq); 244 delete ngram;
|
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/ids2ngram/ |
| ids2ngram.cpp | 78 TNgram ngram; local 80 TSIMWordId* ids = ngram.ids; 83 ++map[ngram]; 124 printf("\t -p para_size # maxium ngram-items per para\n");
|
| /nv-g11n/inputmethod/sunpinyin2/src/slm/ids2ngram/ |
| ids2ngram.cpp | 78 TNgram ngram; local 80 TSIMWordId* ids = ngram.ids; 83 ++map[ngram]; 124 printf("\t -p para_size # maxium ngram-items per para\n");
|
| /nv-g11n/inputmethod/sunpinyin/slm/python/ |
| utils.py | 45 class NGram: 57 return "ngram: " + self.key.__str__() + " freq: " + str(self.freq) 111 ngram = mem.read((n+1)*4) 112 if ngram: 113 data = struct.unpack('%dl' % (n+1), ngram) 114 yield NGram(data[:n], data[n])
|
| /nv-g11n/inputmethod/sunpinyin2/python/ |
| utils.py | 45 class NGram: 57 return "ngram: " + self.key.__str__() + " freq: " + str(self.freq) 111 ngram = mem.read((n+1)*4) 112 if ngram: 113 data = struct.unpack('%dl' % (n+1), ngram) 114 yield NGram(data[:n], data[n])
|
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/ |
| sim_slmbuilder.cpp | 178 void CSlmBuilder::AddNGram(TSIMWordId* ngram, FREQ_TYPE fr) 181 bool brk = isExcludeId(*ngram); 207 branch = branch || (pv.back().child >= v.size()) || (v.back().id != ngram[i-1]) ; 213 v.push_back(TNode(ngram[i-1], ch, fr)); 217 brk = (i > 1 && isBreakId(ngram[i-1])) || isExcludeId(ngram[i]); 224 v.push_back(TLeaf(ngram[nlevel-1], fr));
|
| sim_slmbuilder.h | 71 void AddNGram(TSIMWordId* ngram, FREQ_TYPE fr); 115 // nr[1] is number of ngram items with freq 1, ... 118 // freq is the ngram frequence, not the conditional pr
|
| /nv-g11n/inputmethod/sunpinyin2/src/slm/ |
| sim_slmbuilder.cpp | 178 void CSlmBuilder::AddNGram(TSIMWordId* ngram, FREQ_TYPE fr) 181 bool brk = isExcludeId(*ngram); 207 branch = branch || (pv.back().child >= v.size()) || (v.back().id != ngram[i-1]) ; 213 v.push_back(TNode(ngram[i-1], ch, fr)); 217 brk = (i > 1 && isBreakId(ngram[i-1])) || isExcludeId(ngram[i]); 224 v.push_back(TLeaf(ngram[nlevel-1], fr));
|
| sim_slmbuilder.h | 71 void AddNGram(TSIMWordId* ngram, FREQ_TYPE fr); 115 // nr[1] is number of ngram items with freq 1, ... 118 // freq is the ngram frequence, not the conditional pr
|
| /nv-g11n/inputmethod/sunpinyin/slm/src/slm/slminfo/ |
| slminfo.cpp | 131 TSIMWordId ngram[16]; //it should be N+1, Yet some compiler do not support it
|
| /nv-g11n/inputmethod/sunpinyin2/src/slm/slminfo/ |
| slminfo.cpp | 131 TSIMWordId ngram[16]; //it should be N+1, Yet some compiler do not support it
|