IOException, UnsupportedEncodingException {
int vocabularySize = vocabularyDictionary.size();
Word[] vocabularyWords = new Word[vocabularySize];
char[] chs = new char[128];
for (int i = 0; i < vocabularySize; i ++) {
final Word curWord = vocabularyDictionary.get(i);
curWord.getText().getChars(0, curWord.length(), chs, 0);
chs[curWord.length()] = (char) -1;
Beef beef = new Beef(chs, 0, curWord.length() + 1);
final BitSet bs = new BitSet(curWord.length());
knife.dissect(new Collector(){
public void collect(String word, int offset, int end) {
Hit hit = vocabularyDictionary.search(word, 0, word.length());
if (hit.isHit() && hit.getWord().length() != curWord.length()) {
for (int j = offset; j < end; j++) {
bs.set(j, true);
}
}
}
}, beef, 0);
for (int j = 0; j < curWord.length();j++) {
if (!bs.get(j)) {
vocabularyWords[i] = curWord;
break;
}
}