/** * Read word list from file with name WORDLISTFILENAME, and pass a Set containing those words to * the computer player to intialize its lexicon. */ private void initLexicon(InputStream stream) { ProgressMonitorInputStream pmis; ProgressMonitor progress = null; pmis = new ProgressMonitorInputStream(this, "reading words", stream); progress = pmis.getProgressMonitor(); progress.setMillisToDecideToPopup(10); Scanner s = new Scanner(pmis); myLexicon.load(s); try { pmis.close(); } catch (IOException e) { JOptionPane.showMessageDialog( null, "Error Closing Stream", "Error", JOptionPane.ERROR_MESSAGE); } }
public void runTests(ILexicon lex, ArrayList<String> list) { lex.load(list); doTests(lex); }