No matter what you do to keep the formatting you still need the words 
in a plain text to run through your spell checker.  Using the text 
property saves all the hassle of removing the html formatting.  Thanks 
Adobe!  Things like "<b>appli</b>cation" come back correctly as one 
word.

When I get the plain text i run this regex "/\b\w+/gi;" to parse out 
all the words.  Removes punctuations and such, parsing just on spaces 
won't do.  It's not 100% perfect but can finetune later.

Once I know a word is not spelled correctly against my master word list 
and have the user's corrected spelling, i go find it in the htmlText 
and weave it in.  The only thing that does NOT work really well is when 
a word is formatted differently in itself such 
as "<b>appli</b>cation".  I currently lose that the first 5 letters are 
bolded... oh well.  Can fix later.

What i've found most difficult is the UI to highlight the word so a 
user has context.  For now i'm just using the setSelection since i'm 
spell checking on TextAreas only.

Not sure how you are doing suggestive words but havn't firgured that 
out yet, no algorithm.  I'm loading a 120,000 word list into an array 
collection :)! I'm quite impressed how fast it is, loads in 
milleseconds when i split my text file on \r\n.  Using the build in 
contains to validate each word.  It's faster than calling any other web 
service.

Would like to know what you are doing for suggestive words.

--Scott


--- In [email protected], "jmfillman" <[EMAIL PROTECTED]> wrote:
>
> Ultimately I'm wanting to find each word to check the spelling, while 
> maintaining the HTML formatting of the TextArea. Using the text would 
> be far easier, but I loose the formatting.
>


Reply via email to