int fw[] = pp.getF().getWords();
width = fw.length;
// add null word to the beginning of e sentence:
tcmap = new FloatWritable[(ew.length+1) * fw.length];
int c = 0;
Int2FloatMap ecm = null;
if (_includeEnglishNullWord) {
ecm = counts.get(nullWord);
if (ecm == null) {
ecm = new Int2FloatMap();
counts.put(nullWord, ecm);
}
for (int fi:fw) {
ecm.createIfMissing(fi);
tcmap[c] = ecm.getFloatWritable(fi);
c++;
}
} else { c += fw.length; }
for (int ei:ew) {
IntWritable cew = new IntWritable(ei);
ecm = counts.get(cew);
if (ecm == null) {
ecm = new Int2FloatMap();
counts.put(cew, ecm);
}
for (int fi:fw) {
ecm.createIfMissing(fi);
tcmap[c] = ecm.getFloatWritable(fi);
c++;
}
}
}