You can also perform a spelling check with the SplReplace function. In addition to checking the spelling of the text in the input buffer, SplReplace returns a list of suggested replacements in the output buffer. However, SplReplace returns only a limited list of possible suggestions. You can define the limits placed on SplReplace with the SplLimitSet function. A common use of SplLimitSet is to limit the suggestions to obvious mistakes, such as suggesting "the" for "teh."
Note Because the spelling checker API is designed for a variety of purposes, SplReplace does not replace the checked word with a suggestion. You need to add this capability to your application.