Showing posts from August, 2008

Spell Checker in Dynamics AX

Dynamics AX has a neat little SpellChecker class that can help in catching those spelling mistakes. This can be helpful when you are creating parser which needs to check words for correct spellings. It is very simple to use. Here is a sample job. static void SpellChecker(Args _args) { Array array; List list; ListIterator listIterator; SysSpellChecker sysSpellChecker; int i; ; array = new Array(Types::String); array.value(1,"Hello"); array.value(2,"Werld"); sysSpellChecker = SysSpellChecker::newCurrentDocumentationLanguage(); for(i=1;i<=array.lastIndex();i++) { if(!sysSpellChecker.checkSpelling(array.value(i))) { list = SysSpellChecker::newLanguageId("en-us").getSpellingSuggestions(array.value(i)); listIterator=new ListIterator(list); print "Spelling suggestions for '",array.value(i),"'";