Spell Check (Alexandria 11.0)

Hi,

I want to evaluate TMS Spell Check components.

Regarding "TMS Spell Check DEVELOPERS GUIDE" , I followed steps until "TAdvSpellCheck.Validate" function:

  if (AdvSpellCheck1.Validate(AdvMemo1.Lines.Text) = wvrNotValidated) then
    AdvMemo1.Font.Color := clRed
  else
    AdvMemo1.Font.Color := clWindowText;

I set "Todayy, I went to skool" into AdvMemo1.

The problem is that AdvMemo font color still remains clWindowText.

Is there anything to initialize ?

Regards

In TAdvMemo, the text color is always controlled by syntax rules from the syntaxstyler component that is used with it. So, it isn't intended to use this it like this to just highlight erratic words.
A possible approach could be to define an "error" style of the type keywords and when you find a word that is a spell problem add this erratic word to the error style keywords list. Then TAdvMemo should color this erratic word in the color set for the "error" style.

Reading my post afterwards I realized that it was incomprehensible... I tried to explain that Validate function sent me an incorrect result.

I tried the same example as in the documentation with an AdvEdit instead of an AdvMemo:

if AdvSpellCheck1.Validate(Edit1.Text) = wvrNotValidated then
  Edit1.Color := clRed
else
  Edit1.Color := clWindow;

The problem is that result value from AdvSpellCheck1.Validate(Edit1.Text) is wvrValidated.
With the default english language this sentence "Todayy, I went to skool" is incorrect.

If this returns as wvrValidated, this rather looks like a setup issue with the TAdvSpellCheck component.
Can you verify the setup with the TAdvSpellCheck demo?

Everything is OK in the TadvSpellCheck demo.

I insert my code into the demo and it works:

if AdvSpellCheck1.Validate(EditTmp.Text) = wvrNotValidated then
  EditTmp.Color := clRed
else
  EditTmp.Color := clWindow;

today --> EditTmp.Color in clWindow
todayy --> EditTmp.Color in clRed

If I copy/paste AdvSpellCheck1 component from TadvSpellCheck demo project to my project, it doesn't work: word "today" is always wvrNotValidated

Can you reinitialize the dictionaries.

How can I reinitialize the dictionaries in my project ?

I deleted language from AdvSpellCheck1/Languages tab, then add a new English language but I still have the issue

Well, apparently there must be something different in the language setup between the demo and your app. Verify also there is no wrong / old SPLX file somewhere that is wrongly used (like in EXE folder vs source folder).

In my project directory, I:

  • deleted Win32 directory
  • don't have any TmsSpellchecks files

In my Delphi project, I:

  • deleted old AdvSpellCheck1 component
  • added a new AdvSpellCheck1 component
  • deleted default English language in AdvSpellCheck1 component
  • added a new English language (eng.lat; eng.aff) in AdvSpellCheck1 component

When building the project, I have the creation of "TMSSPELLCHECK.SPLX" (1ko) file in exe directory.

All of this seems to be right when reading help documentation but I still have the same issue.

It's probably a trivial thing but I can't find the solution :thinking:

Hope previous informations could help.

If your SPLX file is only 1kb, clearly, it was not loaded with a full dictionary.
If you do not manage to create the proper SPLX file, you could copy the one from the demo to your app folder.

I copied SPLX file in my exe directory and it works: english spell checking is ok

However I have some weird things in my project:

  • French spell seems to be implement while it's not declare in AdvSpellCheck1 configuration
  • I declare a new language in AdvSpellCheck1, I can visualize it in Structure treeview but in runtime, I only have 1 language available...

I can only suspect that when you make changes at design-time, these are not persisted in the SPLX file you think where it is persisted.
Can you scan your full hard disk for such SPLX file and/or set the SPLX file with an absolute path?

Yes there are some SPLX files in TMS demos but unlinked with my project.

Sorry but I will not spend more time testing these components.

Did you even try to create a new project like written in the "TMS Spell Check.pdf" documentation ?

Again, it must be you do not configure the spell check component correct.

I have retested and it creates by default with the included English dictionary files a 7.3MB SPLX file. You should see actually the process when it first creates the SPLX file as it shows a progress dialog when you first start the app.
Configure the paths to your .AFF & .LAT file under spell check language options, set spellcheck.Active = true and spellcheck.AutoUpdate = true and upon first app start, it should create the SPLX file for the added languages.