// Decompiled by Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   BoggleDictionary.java

import java.io.*;
import java.util.HashSet;
import java.util.Set;

public class BoggleDictionary
    implements Serializable
{

    public BoggleDictionary()
    {
        dictionary = new HashSet(25500);
        try
        {
            BufferedReader bufferedreader = new BufferedReader(new FileReader("Words.txt"));
            String s;
            while((s = bufferedreader.readLine()) != null) 
                dictionary.add(new String(s.toUpperCase()));
            System.out.println("Dictionary parsed, size: " + dictionary.size());
        }
        catch(FileNotFoundException filenotfoundexception)
        {
            System.err.println("Exception: " + filenotfoundexception);
            System.exit(-1);
        }
        catch(IOException ioexception)
        {
            System.err.println("Exception: " + ioexception);
            System.exit(-1);
        }
    }

    public boolean isValid(String s)
    {
        return dictionary.contains(s);
    }

    private Set dictionary;
}
