usedWords.add(word);
// is the word found in the dictionary
boolean foundWord = false;
Pair frenchPinyinTranslation = null;
if (chineseFrench.containsKey(word)) {
frenchPinyinTranslation = getPinyinTranslation(chineseFrench
.get(word));
}
Pair germanPinyinTranslation = null;
if (chineseGerman.containsKey(word)) {
germanPinyinTranslation = getPinyinTranslation(chineseGerman
.get(word));
}
if (frenchPinyinTranslation != null
|| germanPinyinTranslation != null) {
foundWord = true;
// first add subwords
if (word.length() > 1) {// only then subwords can occur
for (String subword : TextBoostUtils
.splitIntoAllSubstrings(word, false)) {
addWordTranslation(result, usedWords, subword,
chineseFrench, chineseGerman,
characterComponents);
}
}
// end of subwords
Object[] row = { "", "", "", "" };
// word, pinyin, french, german
row[0] = word.replace('\t', ' ');
if (frenchPinyinTranslation != null)
row[1] = frenchPinyinTranslation.getKey();
else if (germanPinyinTranslation != null)
row[1] = germanPinyinTranslation.getKey();
if (frenchPinyinTranslation != null)
row[2] = frenchPinyinTranslation.getRight();
if (germanPinyinTranslation != null)
row[3] = germanPinyinTranslation.getRight();
result.addRow(row);
}
if (minimizeMemory && !foundWord) {