/** * Returns the ID of the given word. * * @param word * the word to find the ID * @return the ID of the word */ public final int getWordID(Word word) { UnigramProbability probability = getUnigram(word); if (probability == null) throw new IllegalArgumentException("No word ID: " + word); else return probability.getWordID(); }
/** * Returns the ID of the given word. * * @param word * the word to find the ID * @return the ID of the word */ public final int getWordID(Word word) { UnigramProbability probability = getUnigram(word); if (probability == null) throw new IllegalArgumentException("No word ID: " + word); else return probability.getWordID(); }