Knowledgebase Home Page  >  RapidSpell Web Java
Search the Knowledge Base
How to use a user dictionary in a WAR file.
https://keyoti.com/kb/Default.aspx?ToDo=view&questId=204&catId=45

Options

Print this page
Email this to a friend

If a user dictionary is located in a WAR, it can be read, using the code
below.  Note though, that the 'add' button will not work, as the dictionary
cannot be written to.

 //construct an instance of the core RapidSpell spell checker String licenseKey = "zz";  com.keyoti.rapidSpell.RapidSpellChecker rapidSpellChecker = new
com.keyoti.rapidSpell.RapidSpellChecker(licenseKey);

 // File name of user dictionary inside WAR.
 java.lang.String userFileName = "spellcheck/rapidspell-user.txt"; // get real path to operating system file.  String realpath = config.getServletContext().getRealPath(userFileName);
// instantiate a java File object to the real path.  java.io.File userFile = new  java.io.File( realpath );

 //set the dict file steam to the file. rapidSpellChecker.setUserDictionary(userFile);

<RapidSpellWeb:rapidSpellWeb checkerEngine="<%=rapidSpellChecker %>" SSLFriendly="true" licenseKey="zz"/>


 


Related Questions:

Attachments:

No attachments were found.