Ejemplo n.º 1
0
  /**
   * 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);
    }
  }
Ejemplo n.º 2
0
 public void runTests(ILexicon lex, ArrayList<String> list) {
   lex.load(list);
   doTests(lex);
 }