/** * Returns a list of valid tags for the specified word. * * @param word * The word. * * @return A list of valid tags for the specified word or null if no * information is available for that word. */ public String[] getTags(String word) { if (caseSensitive) { return getTags(dictionary.get(word)); } else { return getTags(dictionary.get(word.toLowerCase())); } }
/** * Returns a list of valid tags for the specified word. * * @param word * The word. * * @return A list of valid tags for the specified word or null if no * information is available for that word. */ public String[] getTags(String word) { if (caseSensitive) { return getTags(dictionary.get(word)); } else { return getTags(dictionary.get(word.toLowerCase())); } }
@Override public String toString() { StringBuilder dictionaryString = new StringBuilder(); int i = 0; for (String word : dictionary.keySet()) { dictionaryString.append(word).append(" -> ") .append(tagsToString(getTags(word))); dictionaryString.append("\n"); if (i > 3) break; i++; } // remove last new line if (dictionaryString.length() > 0) { dictionaryString.setLength(dictionaryString.length() - 1); } return dictionaryString.toString(); }
@Override public String toString() { StringBuilder dictionaryString = new StringBuilder(); int i = 0; for (String word : dictionary.keySet()) { dictionaryString.append(word).append(" -> ") .append(tagsToString(getTags(word))); dictionaryString.append("\n"); if (i > 3) break; i++; } // remove last new line if (dictionaryString.length() > 0) { dictionaryString.setLength(dictionaryString.length() - 1); } return dictionaryString.toString(); }