Permalink
Browse files

Fixed the bugs with json decoding

Changed the html and stylesheet
  • Loading branch information...
1 parent 9f168b3 commit 3f09b003191c0a3234d1d9321ae76fce58c38eb0 @santhoshtr committed Jul 9, 2011
Showing with 41 additions and 9 deletions.
  1. +4 −4 index.html
  2. +25 −3 silpa_comp.php
  3. +12 −2 styles.css
View
@@ -11,19 +11,19 @@
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();">
<p>
<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
@@ -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
@@ -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;

0 comments on commit 3f09b00

Please sign in to comment.