Addict Discuss
Determine if excluded word was found
Thread Starter: Patrick Started: 4/21/2008 4:06 PM UTC
Replies: 4
Determine if excluded word was found

Is there a way to determine, using the LiveSpell piece, if an excluded word was found?

Usage: Mispellings are fine, but an excluded word should prevent a save.
Using this without the dialogs (via Intraweb), only using the LiveSpelling currently though that can change if needed.

Thanks for any insight.
RE: Determine if excluded word was found
Patrick - not sure about that - shall check...

Glenn Crouch, Addict Support
mailto:support@addictivesoftware.com
Addictive Software http://www.addictivesoftware.com
RE: Determine if excluded word was found
I talked with the Author and he says that yes, this can be done, but it'll take just a bit of work...
There is an example in the v3 demo that shows API access to word parsing IIRC.  What would have to be done is the control should be silently parsed when the user attempts to close it and each word should be checked against the exclude list.

This should be done in the same way as it's done at the beginning of the WordAcceptable method (below)... but this would do it (allow you to tell if a word was excluded without involving UI).

function TAddictSpell3Base.WordAcceptable( const Word:String ):Boolean;
var
   Number      :Extended;
   CaseChange  :String;
begin
   Result := True;
   if (WordExists( Word )) then
   begin
       if (FUseExclude) and (WordExcluded( Word )) then
       begin
           Result := False;
       end;
       exit;
   end;
   CaseChange := GetCaseModification( Word );
   if (WordExists(CaseChange)) then
   begin
       if (FUseExclude) and (WordExcluded(CaseChange)) then
       begin
           Result := False;
       end;
       exit;
   end;


Glenn Crouch, Addict Support
mailto:support@addictivesoftware.com
Addictive Software http://www.addictivesoftware.com
Re: RE: Determine if excluded word was found
Thanks Glen
Sounds feasible. I'll be checking it out this evening and I'll let you know how it turns out, thank you for the details, and for having demos that at least point the way (sorry that I didn't review them more closely for something to base this off of)
RE: RE: Determine if excluded word was found
Patrick,

This forum is here to ask questions :)

Let us know how you go...

Glenn Crouch, Addict Support
mailto:support@addictivesoftware.com
Addictive Software http://www.addictivesoftware.com