Google Spell Check API

I want to add spell check programin ornagai but I can’t. MAMP didn’t support pspell library. So, I removed in ornagai V2. I really miss this function. It’s nice and very helpful. So, if we can check like google spell checking system, it’s more easier to search for user in Ornagai. I found google spell check api and it’s very useful for. I’m planning to add this function in ornagai.com. It will come soon in ornagai.com. I found following code from jquery spell check.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
header("Content-Type: text/xml; charset=utf-8");
 $text = urldecode("mystary");
$body = '<!–?xml version="1.0" encoding="utf-8" ?–>';
 $body .= '';
 $body .= ''.$text.'';
$body .= '';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
 curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
curl_close($ch);
print $contents;
?>

 

comments powered byDisqus