Spell checking in Rev apps?

Scott Morrow scott at elementarysoftware.com
Thu Feb 23 01:35:01 EST 2006


Tom:
I'm pleased that you found it useful!

Sivakatirswami:
One way to make sure all the text is set back to the default color  
might be to:

      lock screen -- hide the following selection process
      select text of tSpellField -- your field name here	
      set the foregroundColor of the selectedChunk to empty -- return  
all text to its native color

Of course this assumes that your field doesn't contain any odd pieces  
of text that are *supposed* to be colored differently.

-Scott

On Feb 21, 2006, at 3:24 PM, Sivakatirswami wrote:

> Jonathan:
>
> Excellent solution...so simple...  I really need to get this going  
> here.
>
> 1) Did you add any other bells and whistles? such as a suggestions  
> list for corrections? I'm thinking  now, for simplicity sake: offer  
> a list of words that begin with the same letter.  I know there are  
> lots of special algorithms for a  more focused offering of close  
> options, but it's probably over my head to implement in transcript...
>
> 2) What are you using as your standard dictionary-word list?
>
> 3) Once you colorize the mis-spelled word and they fix it.. what's  
> your clean up routine to restore to black?
>
> Thanks!
>
> Sivakatirswami
>
>
>
> On Feb 21, 2006, at 4:38 AM, Jonathan Lynch wrote:
>
>> I have apps I created for my job that do spellchecking. Works great.
>>
>>
>> What you do is load the word list into a custom property of your  
>> stack for
>> storage
>>
>> Then use a script like this:
>>
>> on preopenstack
>>   global gWordList
>>   put the listofwords of me into tList
>>   repeat for each word tWord in tList
>>     put "true" into gWordList[tWord]
>>   end repeat
>> end preopenstack
>>
>> This creates a global array with each element named after each  
>> word in your
>> word list, with "true" as the content of that array.
>>
>>
>>
>> Then, when you check words, you do something like this:
>>
>> on closefield
>>   lock screen
>>   global gWordList
>>   put 0 into tCount
>>   repeat for each word tWord in me
>>     add 1 to tCount
>>     if not gWordList[tWord] then set the bgcolor of word tCount of  
>> me to
>> yellow
>>   end repat
>> end closefield
>>
>> This checks, for each word in the field, to see if that word is a  
>> part of
>> the global array, and if it contains the word "true" ("if not" is a
>> shorthand way of doing that)
>>
>>
>> There are lots of nuances, of course, depending on how you want to  
>> handle
>> punctuation - but that is relatively straight forward text  
>> manipulation.
>>
>> good luck,
>>
>> Jonathan
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list