am eddfbb68: Add a helper method

* commit 'eddfbb68dcff55c85b3d5b82d406f543bd038825':
  Add a helper method
main
Jean Chalard 2012-01-15 19:24:35 -08:00 committed by Android Git Automerger
commit 1eece82fe5
1 changed files with 10 additions and 0 deletions

View File

@ -434,6 +434,16 @@ public class FusionDictionary implements Iterable<Word> {
return currentGroup;
}
/**
* Helper method to find out whether a word is in the dict or not.
*/
public boolean hasWord(final String s) {
if (null == s || "".equals(s)) {
throw new RuntimeException("Can't search for a null or empty string");
}
return null != findWordInTree(mRoot, s);
}
/**
* Recursively count the number of character groups in a given branch of the trie.
*