From 6efac625b687b945d423cd9651e653a995a1e11d Mon Sep 17 00:00:00 2001 From: Richard Castro Mamani Date: Sat, 19 Sep 2015 07:08:18 -0500 Subject: [PATCH] Correcting a bug when 100% unknown words are passed. --- ServerSide/Hinantin/cgi-bin/spellcheck31/script/ssrv.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ServerSide/Hinantin/cgi-bin/spellcheck31/script/ssrv.cgi b/ServerSide/Hinantin/cgi-bin/spellcheck31/script/ssrv.cgi index df905da..b3275ae 100755 --- a/ServerSide/Hinantin/cgi-bin/spellcheck31/script/ssrv.cgi +++ b/ServerSide/Hinantin/cgi-bin/spellcheck31/script/ssrv.cgi @@ -209,7 +209,13 @@ elsif ($cmd eq "check_spelling") { if (not $correct) { # the word is misspelled $object->AddIncorrectEntry($word); my $suggestions = $object->getSuggestions($word); - $suggestions = "[$suggestions]"; + if ($suggestions =~ /\?\?\?/) + { + $suggestions = "[\"???\"]"; + } + else { + $suggestions = "[$suggestions]"; + } my $ud = "false"; $result = $result . "{ \"word\": \"$word\", \"ud\": \"$ud\", \"suggestions\": $suggestions}," ; }