I've looked around to find a way to see if a string is a valid english word but all the solutions I find involves me using a predefined list of words. I just want the string to be compared against a local dictionary. Is there a way to do this?
Right now my code takes in a string and is sent to this method
try {
BufferedReader in = new BufferedReader(new FileReader("/usr/local/share/dict"));
String str;
while ((str = in.readLine()) != null) {
if ( str.contains( word )) {
return true;
} else {
return false;
}
}
in.close();
} catch (IOException e) {
}