/** * Add words from a Reader to existing dictionary hashmap. * This function can be called as many times as needed to * build the internal word list. Duplicates are not added. * <p> * Note that adding a dictionary does not affect the target * dictionary file for the addWord method. That is, addWord() continues * to make additions to the dictionary file specified in createDictionary() * <P> * @param wordList a Reader object that contains the words, on word per line. * @throws IOException */ public void addDictionary(Reader wordList) throws IOException { addDictionaryHelper(new BufferedReader(wordList)); }
/** * Add words from a file to existing dictionary hashmap. * This function can be called as many times as needed to * build the internal word list. Duplicates are not added. * <p> * Note that adding a dictionary does not affect the target * dictionary file for the addWord method. That is, addWord() continues * to make additions to the dictionary file specified in createDictionary() * <P> * @param wordList a File object that contains the words, on word per line. * @throws FileNotFoundException * @throws IOException */ public void addDictionary(File wordList) throws FileNotFoundException, IOException { addDictionaryHelper(new BufferedReader(new FileReader(wordList))); }