GithubHelp home page GithubHelp logo

Comments (19)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Last comment was about jquery.spellchecker.js, at line 62

Original comment by xavi.ivars on 10 Feb 2010 at 5:53

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I have also problems in checkspelling.php, at line 49, related with UTF-8

I can solve them by replacing

$words[] = utf8_encode(html_entity_decode($word));

with

$words[] = html_entity_decode($word);


Original comment by xavi.ivars on 10 Feb 2010 at 5:56

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Maybe using XRegExp for regular expressions instead of native RegExp Object 
would be a 
good idea.

http://xregexp.com/

Original comment by xavi.ivars on 10 Feb 2010 at 6:43

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Thank you for letting me know about this (somewhat serious) issue. I need to 
get a
better understanding of how Javascript regex matches word characters to fix 
this.
Thanks for your code examples and the link, I am currently looking into this.

Original comment by [email protected] on 10 Feb 2010 at 8:10

  • Changed state: Accepted

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
i've changed how i'm matching non-word characters, and i think its matching most
unicode characters. please can you let me me if this change works for you. 

http://code.google.com/p/jquery-spellchecker/source/detail?r=89

Original comment by [email protected] on 10 Feb 2010 at 9:22

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
highlighting the words is broken though, i'm wording on that now..

Original comment by [email protected] on 10 Feb 2010 at 9:36

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
With revision 89 non-word characters works fine, thanks ;)

There is another problem, with word boundaries (\b): when a word starts/ends 
with a 
non-ascii character, RegExp(\b+word+\b) does not work properly.

Original comment by xavi.ivars on 10 Feb 2010 at 10:09

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I've made a change to fix this, although google is not returning the correct 
data for
the example word 'wàéèíóòúÀÉÈÍÓÒÚ'

It works fine with pspell, i'll need to spend more time looking at this issue. 

if you want to test please use the latest revision, i commited some debug code 
by
mistake.

Original comment by [email protected] on 10 Feb 2010 at 11:04

  • Added labels: Component-Logic, OpSys-All, Priority-High, Usability
  • Removed labels: Priority-Medium

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
you can test using the 
[http://spellchecker.jquery.badsyntax.co.uk/#textarea-example
textarea demo]. using pspell it returns the matched bad word, google returns
something different

Original comment by [email protected] on 10 Feb 2010 at 11:17

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Thanks! I'm using pspell, so no problems for me with google bug ;)

Anyway if you think I could help you with anything, please tell me ;)

Original comment by xavi.ivars on 10 Feb 2010 at 11:18

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Thanks dude, you've already been a big help! I'll keep this issue ticket open 
until
i'm confident the changes i've made works with a variety of different unicode 
word
characters (not sure the regex range is suffice at this time).

Original comment by [email protected] on 11 Feb 2010 at 9:46

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Have you managed to fix bug with Google?

Can it be related with "strlen" in line 111 of checkspelling.php?

Original comment by xavi.ivars on 11 Feb 2010 at 11:00

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
it makes sense that's where the problem is, i've been unable to come up with a
solution, mb_strlen() also doesn't do it. i'll need to spend more time on this, 
i'm
not experienced with encodings :/

Original comment by [email protected] on 12 Feb 2010 at 12:08

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
At rev142 and using pspell, all the words having french accents (éè etc) 
would get
marked as having a mistake and all the suggestions with accents would show up 
as null
in the popup.

To fix this, I modified the two following lines

40:  exit(json_encode(array_map(utf8_encode, pspell_suggest($pspell_link,
utf8_decode(urldecode($suggest))))));

45:  foreach($text = explode(' ', utf8_decode(urldecode($text))) as $word) {

It seems to be working.

Original comment by [email protected] on 14 Apr 2010 at 9:32

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I was having issues with utf-8 characters and pspell. I modified the following 
two lines in checkspelling.php:

36: $pspell_link = pspell_new_personal($this->pspell_personal_dictionary, 
$this->lang,"","","utf-8");

57: @pspell_add_to_personal($pspell_link, 
utf8_decode(strtolower($addtodictionary))) or die('You can\'t add a word to the 
dictionary that contains any punctuation.');

Original comment by [email protected] on 20 Aug 2010 at 4:14

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
One more fix. I also had to modify lines 39-41:

if (isset($suggest)) {
  $suggestions = pspell_suggest($pspell_link, urldecode($suggest));
  foreach($suggestions as $k => $val)
    $suggestions[$k] = htmlentities($val,ENT_NOQUOTES,'UTF-8');
  exit(json_encode($suggestions));  
} 

Original comment by [email protected] on 20 Aug 2010 at 4:36

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Re the google issue, it seems to be that substr doesn't like unicode characters 
and so the badword box has the wrong offset for the substr and displays a funny 
selection.

$word = substr($text, $word[1], $word[2]);

I seem to have got around this 

$word = substr(utf8_decode($text), $word[1], $word[2]);

While this may cause some encoding issue in the actual $text variable it seems 
to allow for correct calculation of substr.

Alternatively this works as well:

$word = mb_substr($text, $word[1], $word[2], 'utf8');

but as mbstring is a non-default php extension it may not work for everyone and 
mbstring functions won't correctly work.

Original comment by [email protected] on 10 May 2011 at 12:45

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
Hi, 
I am facing the problem with '&' (ampersand) , when my text contains the 
character '&' the google check spell is not working but it is working fine when 
i removing the '&' from text.

check spelling is not working for the below Text:
Madison Short Sleeve Organic Babydoll Tee Shirt &  Victory Pump

check spelling is working fine after removing the '&':
Madison Short Sleeve Organic Babydoll Tee Shirt  Victory Pump


Please let me know how can i fix this issue.


Thanks
Srinivas Gade
Email:[email protected]

Original comment by [email protected] on 22 Nov 2011 at 1:18

from jquery-spellchecker.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 11, 2024
I've been unable to replicate any of the issues mentioned in this ticket using 
the new version of the plugin, which can be found here: 
https://github.com/badsyntax/jquery-spellchecker

Please can you test here: http://jquery-spellchecker.badsyntax.co/textarea.html

If you find any issues please create a ticket in the new issue tracker here: 
https://github.com/badsyntax/jquery-spellchecker/issues

Original comment by [email protected] on 20 Oct 2012 at 4:47

  • Changed state: Done

from jquery-spellchecker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.