Web service

 

Description
Integration

 

Description of the Spell Checker web service

The web service WebEst allows the integration of the Bulgarian Spell Checker into various types of web applications. The integration is performed through а Java script component which handles requests to the web service as well as the communication with the user interface.

The integrated application submits direct queries to the web service to check words spelling and generates suggestions for correction of misspelled words.

The web service is compatible with the widely used jQuery plugin jquery-spellchecker, which allows direct integration with a number of web components for texts editing, such as: MarkItUp, jHtmlArea, WYMeditor, YUI, Dojo, NicEdit, etc.

Checking for misspelled words

Request:

http://dcl.bas.bg/est/checkspelling.php?engine=dcl

Content type: application/x-www-form-urlencoded;charset=UTF-8
Data: text=”a chunk of text without any punctuation”

Response:

Content type: application/json
Example response: ["ябалка","кориер","ношница"]

Suggestions for words correction

Request:

http://dcl.bas.bg/est/checkspelling.php?engine=dcl

Content type: application/x-www-form-urlencoded;charset=UTF-8
Data: suggest=”ношница”

Response:

Content type: application/json
Example response: ["нощница","ножница","кошница"]

 
back to top

Integration with jquery-spellchecker

To integrate the Spell Checker service WebEst, download jQuery Javascript Spelling Checker and include in the head section of your html document the following:

<link rel="stylesheet" type="text/css" media="screen" href="css/spellchecker.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.spellchecker.js>></script>

Default usage:

		
$("textarea#text-content")
.spellchecker({
	 url: 'http://dcl.bas.bg/est/checkspelling.php',
        lang: "bg",
      engine: "dcl"
})
.spellchecker("check");

All options:

		
$("textarea#text-content")
.spellchecker({
        url: 'http://dcl.bas.bg/est/checkspelling.php',  
          // url of WebEst web service
        lang: "bg",    // Bulgarian language 
        engine: "dcl",   // dcl spell engine
        addToDictionary: false,  // currently not supported
        wordlist: {
                action: "after",  // jquery dom insert action
                element: $("#text-content") 
                 // object on which it is applied
        },      
        suggestBoxPosition: "below",  
           // position of the box with suggestions; 
           // above or below the highlighted word
        innerDocument: false 
           // "true" if applied on html element
           // "false" for textarea

back to top