ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Clipboard Help+Spell

3 Feature Ideas

<< < (5/5)

ewemoa:
Thanks for the WordPress-related link.  

Looking at:

  http://core.trac.wordpress.org/attachment/ticket/4807/word-count3.2.patch

some relevant bits appear to be:


--- Code: Javascript ---tx = tx.replace( /[0-9.(),;:!?%#$¿'"_+=\\/-]*/g, '' );        tx.replace( /\S\s+/g, function(){tc++;} );
quoted code may be garbledNot sure how to get the forums to accept the original code...


A brief glance suggests that after dropping characters from a certain set, a count is made of sequences of a non-space character followed by one of more space characters.

My current testing code takes a vaguely similar approach of trying to drop certain characters before attempting a count of modified text.

I'm having difficulty getting things to work out at the moment and it seems to have to do with the use of instances of the UTF-8 "RIGHT SINGLE QUOTATION MARK" that appear to be in your posts (e.g. see the word "don't" in the first sentence of the sample selection).  I'm not confident yet what the difficulty I am experiencing is, but it may have to do with Clipboard Help and Spell not being Unicode aware:

  https://www.donationcoder.com/forum/index.php?topic=24979.msg250346#msg250346

jshare:
Doh! Well I don't expect you to compensate for the lack of UTF-8. Maybe Mouser's planning on making CHS UTF-8 aware and we can revisit this then.

Navigation

[0] Message Index

[*] Previous page

Go to full version