Aspell_new: loads a new dictionary in the PHP script. Aspell_check: check a single word. Aspell_check-raw: check for a single word and do not change or correct even if spelling is wrong. Aspell_suggest: checks a single word and provides
Spelling check function library in PHP script
Aspell_new: loads a new dictionary. Aspell_check: check a single word. Aspell_check-raw: check for a single word and do not change or correct even if spelling is wrong. Aspell_suggest: checks a single word and provides spelling suggestions.
Aspell_new
Load a new dictionary.
Syntax: int aspell_new (string master, string personal );
Return value: integer
Function type: Material Processing
Content clarifies that this function is loaded into a new dictionary and assigned with a new identity value (integer) for application in the program.
Application model $ aspell_link = aspell_new ('INC ');
Aspell_check
Check a single word.
Syntax: boolean aspell_check (int dictionary_link, string word );
Return value: Boolean
Function type: Material Processing
Content clarification this function checks the spelling of a single word. If the spelling is accurate, true is returned. if the spelling is inaccurate, false is returned.
Application model
$ Aspell_link = aspell_new ('English ');
If (aspell_check ($ aspell_link, 'testt ')){
Echo 'This is a valid spelling ';
} Else {
Echo 'Sorry, wrong spelling ';
}
Aspell_check-raw
Check a single word and do not change or correct it even if it is spelled incorrectly.
Syntax: boolean aspell_check_raw (int dictionary_link, string word );
Return value: Boolean
Function type: Material Processing
Content clarification
This function checks the spelling of a single word. If the spelling is accurate, true is returned. if the spelling is inaccurate, false is returned. This function does not change or correct the spelling of the app.
Application model
$ Aspell_link = aspell_new ('English ');
If (aspell_check_raw ($ aspell_link, 'testt ')){
Echo 'This is a valid spelling ';
} Else {
Echo 'Sorry, wrong spelling ';
}
Aspell_suggest
Check a single word and provide spelling suggestions.
Syntax: array aspell_suggest (int dictionary_link, string word );
Returned value: Array
Function type: Material Processing
Content clarification
This function checks the spelling of a single word. And give possible spelling and accurate suggestions to return results in array type.
Application model
$ Aspell_link = aspell_new ('English ');
If (! Aspell_check ($ aspell_link, 'testt ')){
$ Suggestions = aspell_suggest ($ aspell_link, 'testt ');
For ($ I = 0; $ I <count ($ suggestions); $ I ){
Echo 'possible spelling: '. $ suggestions [$ I].'
';
}
}
?>