This section lists all external commands which make up the interface to the spell checker engine. You should use the reference together with the spell checker library source to gain a full understanding on how and when the individual commands are used.ReferenceNote: All external commands return a value. Unless indicated otherwise, a negative return value indicates an error.
SPLLaddUserWord( lexID, word )
Adds the given word to the specified open user dictionary. If lexID specifies -1, the word is added to the current user dictionary, as set by SPLLsetCurUserLex.
SPLLcheckBlock( &badWord, &otherWord, &badWordPos )
Checks the current block of text and returns the offending word, possible replacement, and the character position of the offending word. The character position is relative to the beginning of the sentence in which the word was found. You can use SPLLgetBlockSentence to fetch the sentence in question.
SPLLcheckBlock returns one of the following values:
SPLL_OK_RSLT (0) - No offending words have been found.
SPLL_MISSPELLED_WORD_RSLT (1) - The word returned in badWord was misspelled. Use SPLLsuggest to get a list of suggestions.
SPLL_CONDITIONALLY_CHANGE_WORD_RSLT (4) - An alternative spelling for the word is returned in otherWord. You can still use SPLLsuggest to get a further suggestions with otherWord placed at the top of the list.
SPLL_UNCAPPED_WORD_RSLT (8) - A word at the beginning of a sentence is not capitalised, but spelled correctly. The capitalised version is returned in otherWord.
SPLL_MIXED_CASE_WORD_RSLT (16) - A word with mixed case has been found. The replacement is returned in otherWord.
SPLL_MIXED_DIGITS_WORD_RSLT (32) - A word with a mixture of digits has been found.
SPLL_END_OF_BLOCK_RSLT (64) - The end of the block has been reached, and no more offending words have been found.
SPLL_DOUBLED_WORD_RSLT (128) - A duplicate word has been found. The word should be deleted.
A negative result indicates an error.
SPLLcheckWord( word, &otherWord )
Checks an individual word. See SPLLcheckBlock for possible results. You do not need to call SPLLopenBlock to use this command. Note: SPLLcheckWord will not return SPLL_UNCAPPED_WORD_RSLT or SPLL_DOUBLED_WORD_RSLT.
Call SPLLclearIgnores to delete all words which have been added to the memory dictionary by SPLLignoreBlockWord or SPLLreplaceBlockWord. When you call SPLLignoreBlockWord( kTrue ), the offending word is added to the memory dictionary. When you call SPLLreplaceBlockWord the replacement word is remembered in the memory dictionary and will be returned as an alternative, the next time SPLLcheckBlock encounters the same offending word.
SPLLclearUserLex( lexID )
Removes all words from the specified user dictionary.
SPLLcloseBlock( [&text, &changed] )
Closes the current block of text. SPLLcloseBlock will return the corrected block of text in the optional parameter text and return kTrue in changed, if the block of text has been modified. See SPLLopenBlock for further detail. If the user has cancelled the session, you can call SPLLcloseBlock without any parameters.
SPLLcloseUserLex( lexID )
Closes the specified user dictionary.
Should be called if SPLLcheckBlock returned SPLL_DOUBLED_WORD_RSLT, indicating that a duplicate word has been encountered, and the word is to be deleted.
SPLLgetBlockSentence( &sentence )
Can be used to fetch the sentence of an offending word which was returned by SPLLcheckBlock.
SPLLgetError( &errorCode, &functionName )
Returns the last error in errorCode, and the name of the external command which produced it, in functionName. You would typically call it from your error handler procedure. See SPLLsetErrorHandler.
SPLLgetLexText( lexID, &text )
Returns the words of the specified user dictionary in a text field. The words are returned as one word per line.
SPLLgetOption( option )
Returns the value of the specified option. See SPLLsetOption for more details.
SPLLgetReplaceInfo( start, end, text )
This procedure can be called from within your replace handler procedure. See SPLLsetReplaceHandler and ReplaceHandler for more information. SPLLgetReplaceInfo returns the start and end range of the text to be replaced together with the text which replaces it. The text parameter may be empty if, for example, a duplicate word has been deleted.
SPLLgetUserLexList( &openList[, &closeList] )
Returns two lists, one of all open user dictionaries and one of all closed user dictionaries. The list to receive the open dictionaries must have three columns, dictionary name (Character), dictionary ID (Long integer), and default (Boolean). The list to receive the closed dictionaries only requires one column for the name.
SPLLignoreBlockWord( [all] )
Should be called when an offending word was found by SPLLcheckBlock and the word is to be ignored. If kTrue is specified in the parameter, all identical words in the current block will be ignored.
SPLLloadOptions( path )
Loads the options from a disk file which have previously been saved by SPLLsaveOptions.
Returns 1 if successful or 0 if the file didnt exist. Negative values indicate an error.
SPLLopenBlock( text )
Prepares the spell checker to check a block of text. You can not open more then one block at a time, and you must always call SPLLcloseBlock when finished. You can use SPLLcheckBlock to check your block of text. The size of the text block is only restricted by the amount of available memory and the OMNIS limit of 10 million characters.
SPLLopenUserLex( lexName[, wordList] )
Opens the specified user dictionary which must be located in the directory specified by SPLLsetUserLexPath. If successful it returns a value between 0 and 31 which is the dictionary ID. If lexName is empty, a memory dictionary is opened. The memory dictionary receives its words from an OMNIS list passed in parameter 2.
SPLLreplaceBlockWord( word[, all] )
Should be called when an offending word was found by SPLLcheckBlock, and the word is to be replaced. If kTrue is specified for the parameter all, all identical words in the current block will be replaced.
SPLLsaveOptions( path )
Saves the current spell checker options to a disk file. The parameter path must contain the full path and file name.
Returns 1 if successful.
SPLLsetBlockSentence( sentence )
Can be called to replace the current sentence. A sentence is made current by SPLLcheckBlock when an offending word is encountered.
SPLLsetCurUserLex( lexID )
Sets the current user dictionary to which words are added when SPLLaddUserWord is called with a parameter of -1.
SPLLsetErrorHandler( procedureName )
Sets the error handling to the given OMNIS procedure. When an error occurs inside the spell checker external, the specified procedure is called. This procedure can then call SPLLgetError and handle it appropriately. The procedure name must be specified as formatName/procedureNumber or procedureName, i.e. SPLLsetErrorHandler(mSpell/ErrorHandler).
SPLLsetLangLex( lexName, langID )
Call this command to set the current language dictionary. In lexName you must specify the compiled language dictionary, and langID must specify the language Id. See SPLLsetOption for the list of language Ids. All currently open language dictionaries are closed prior to opening the new set of language dictionaries.
SPLLsetLangLexPath( path )
Call this command to specify the full path to the directory which contains the language dictionaries.
SPLLsetLexText( lexID, text )
Replaces the words of the specified dictionary with the words specified by the given text. The words must be specified as one word per line.
SPLLsetOption( option, value )
Sets the specified spell checker option.
The parameter option can be one of the following:
SPLL_IGNORE_MIXED_CASE_OPT (2) - Sets the ignore words with mixed case option. The value can be kTrue or kFalse.
SPLL_IGNORE_MIXED_DIGITS_OPT (4) - Sets the ignore words with mixed alpha and numeric characters option. The value can be kTrue or kFalse.
SPLL_IGNORE_ALL_CAPS_WORD_OPT (8) - Sets the ignore words with all caps option. The value can be kTrue or kFalse.
SPLL_LANGUAGE_OPT (-2147483646) - Sets the current language code. Only dictionaries with the matching language code or the code for Any Language will be used. The value can be one of the following:
American English (24941)
British English (25202)
Catalan (29539)
Czechoslovakian (25466)
Danish (25697)
Dutch (25717)
Finnish (26217)
French (26226)
German (26469)
Hungarian (26741)Italian (26996)
Norwegian Bokmal (25442)
Norwegian Nynorsk (25444)
Polish (28780)
Portuguese Brazil (28770)
Portuguese Iberian (28783)
Russian (29301)
Spanish (29552)
Swedish (29559)
Any Language (30840)SPLLsetOption returns 1 if successful.
SPLLsetReplaceHandler( procedureName)
This command is typically used when one wants to check an ACWrite external area or other editors which contain rich text. When a replace handler procedure is specified, the spell checker engine will call the procedure for individual pieces of text as they are being changed. The procedure name must be specified as libraryName.formatName/procedureNumber or procedureName, i.e. SPLLsetReplaceHandler(example.wACWriteExample/ReplaceHandler). To clear the procedure, simply call SPLLsetReplaceHandler(""). See SPLLgetReplaceInfo and ReplaceHandler for more information.
SPLLsetUserLexPath( path )
Call this command to specify the full path to the directory which contains the user dictionaries.
SPLLsuggest( badWord, depth, &suggestions[, repWord] )
Call SPLLsuggest to fetch a list of suggestions for an offending word. The depth specifies the search depths (1 to 100) and will effect the accuracy and speed of the search. The recommended values are 25, 50 or 75, were 75 is the most accurate but slowest, and 25 the fastest but least accurate. OSpell defaults to 50. The optional parameter repWord can take the word suggested by SPLLcheckBlock or SPLLcheckWord. SPLLsuggest will make sure that this word will appear at the beginning of the list of suggestions.