Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed the bugs with json decoding

Changed the html and stylesheet
  • Loading branch information...
commit 3f09b003191c0a3234d1d9321ae76fce58c38eb0 1 parent 9f168b3
@santhoshtr authored
Showing with 41 additions and 9 deletions.
  1. +4 −4 index.html
  2. +25 −3 silpa_comp.php
  3. +12 −2 styles.css
View
8 index.html
@@ -11,11 +11,11 @@
return true;
}
</script>
- <title></title>
+ <title>Indic Online Spellchecker</title>
</head>
<body>
<h1>Indic Online Spellchecker</h1>
- <h3>An indic online spellchecker application. Supports all Indian languages and English</h3>
+ <p>An indic online spellchecker application. Supports all Indian languages and English. The text can be a mix of any of the supported languages. Languages will be automatically identified. Click on the red link in the spell check results to see the suggestions.</p>
<!--<a href="spell.zip">Download spell zip file</a>-->
<br />
<form action="submitTest.php" method="post" onsubmit="return checkForm();">
@@ -23,7 +23,7 @@
<textarea class="spell_check" rows="20" cols="100" name="box1">നീലതാമര calqulate</textarea>
</p>
</form>
- <h3>This application is proudly powered by <a href="http://smc.org.in/silpa">Silpa</a>,
- The Indian Language Computing Service.</h3><p> UI is adopted from <a href="http://www.broken-notebook.com/spell_checker/index.php">ajax-spell</a> project. </p>
+ <h3>This application is proudly powered by <a href="http://silpa.org.in">Silpa</a>,
+ The Indian Language Computing Project.</h3><h5> UI is adopted from <a href="http://www.broken-notebook.com/spell_checker/index.php">ajax-spell</a> project. </h5>
</body>
</html>
View
28 silpa_comp.php
@@ -14,7 +14,7 @@
* GPLV3
*/
require_once 'jsonRPCClient.php';
-if(!defined('SILPA_JSONRPC_SERVICE_URL')) define('SILPA_JSONRPC_SERVICE_URL','http://localhost:8080/JSONRPC');
+if(!defined('SILPA_JSONRPC_SERVICE_URL')) define('SILPA_JSONRPC_SERVICE_URL','http://silpa.org.in/JSONRPC');
function silpaspell_create(){
return new SilpaSpell();
@@ -29,6 +29,10 @@ function silpaspell_suggest(&$dict, $word){
return $dict->suggest($word);
}
+function silpaspell_check_batch(&$dict, $word){
+ return $dict->check_batch($word);
+}
+
/**
* Class to provide pspell functionality through silpa
*
@@ -63,7 +67,7 @@ function suggest($word)
if (empty($word)) {
return true;
}
- $suggestions = json_decode($this->service->execute('modules.Spellchecker.suggest',array($word)));
+ $suggestions = $this->service->execute('modules.Spellchecker.suggest',array($word));
return $suggestions;
}
@@ -78,10 +82,28 @@ function check($word)
if (empty($word)) {
return true;
}
- if( json_decode($this->service->execute('modules.Spellchecker.check',array($word)))){
+ if( $this->service->execute('modules.Spellchecker.check',array($word))){
return true;
}
return false;
}
+
+ function check_batch($text)
+ {
+ $text = trim($text);
+
+ if(empty($text))
+ {
+ return $text;
+ }
+
+ $words = $this->service->execute('modules.Spellchecker.check_batch',array($text));
+ if(!empty($words))
+ {
+ return $words;
+ }
+
+ return $text;
+ }
}
?>
View
14 styles.css
@@ -1,7 +1,17 @@
body {
- /*background-color: #CCCCCC;*/
+ background-color: #FFFFF;
+ margin-left:20%;
+ margin-right:20%;
+}
+h1, h2,h3,h4,h5 {
+ color:blue;
+ text-shadow: #6374AB 1px -1px 1px;
+ text-align:center;
+}
+textarea{
+ width:100%;
+ border-color:blue;
}
-
.spell_checker_cp_check {
width: 16px;
height: 16px;
Please sign in to comment.
Something went wrong with that request. Please try again.