Java library to be used to interact with the live HON Solr REST service.
The library uses Google Gson to parse the JSON result from the HON spellcheck server. The Maven JUnit tests should demonstrate this.
Download the code and do:
mvn install
Then add the following to your pom.xml:
<dependencies>
...
<dependency>
<groupId>org.healthonnet.spellchecker</groupId>
<artifactId>hon-spellchecker-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
...
</dependencies>
// language, number of suggestions to return, input string
SpellcheckResponse spellcheckResponse =
SpellcheckRequester.getSpellcheckResponse(SpellcheckDictionary.English, 1, "alzeimer");
List<Suggestion> suggestions = spellcheckResponse.getSpellcheck().getSuggestions();
// prints "alzheimer"
System.out.println(suggestions.get(0).getSuggestedCorrections().get(0).getWord());
Nolan Lawson
Health on the Net Foundation