[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with the parser (WPAddict)



Hi,

I´m having a problem with the WPAddict add-on about its parser.

Sometime ago I have answered about being able to configure if a word, not
only by the word itself, but by its property (on WPTools it should be a
field, an hyperlink, a protected piece of text), should or not be ignored,
even if not on the dictionary. I have posted a change on the
"WPOnSpellCheckWord" that would handle it, but the change didn´t came on
Addict version 3.4. I changed it by myself, and I am sending it attached.
maybe you could handle it with others changes...

Also, I created an inheritance of TAddictAutoLiveSpell and
TCustomDictionary, to handle the popup menu, overriding with a TdxPopupMenu
and others peculiarities on our dictionaries (mostly based on case
sensitiveness).

Well.. the real reason of this post is about the GetWord procedure...

On my documents, I have fields, that are delimited by "[" and "]".. like "My
name is [people name], and I ....."

I have noted two different behaviors while recognizing a word, that are
raising a big problem to me.

1. While typing, it uses the "OnCompleteWord" event, that uses the
WPRichText.CPWord function to get the last word typed by the user.... for
the above example.. it would return:

 - My
 - name
 - is
 - [people
 - name]
 - and
 - .....

2. While executing the spellcheck on the text, it uses
AddictSpell.CheckParser(Parser, CheckType), that internally doesn´t uses the
WPRichText.CPWord function to retrieve words, but instead, it uses
WPRichText.CPChar^, that returns only one char, and with this chars, the
Addict parser is responsible to create the words, that will return, for the
same above example:

 - My
 - name
 - is
 - people
 - name
 - and
 - .....

Note that the "[" and "]" chars are not recognized by the Addict parser..
(because are not word delimiters).. and so, while executing the spell check
of the document, the "[people" and "name]" words, that are signed as
misspeled (red line below), doesn´t popup the window, because the parser
thinks to be "people" and "name" words, that are on the dictionary.

So, What can I do?

I thought changing "WPOnAfterCompleteWord" event, making some cleaning
procedure on the word to remove this kind of chars ["[", "]", "(", ")", "{",
"}", "º", "ª", ....].. but I don´t know if there is a better way inside
Addict to define the "ignore list"...

Could you help me with it?

Thanks

Alessandro Fragnani de Morais
Analista de Sistemas
Softplan/Poligraph
Sistema da Qualidade Certificado ISO9001-BVQI/INMETRO
Fone/Fax: 0xx(48) 3027-8000
http://www.softplan.com.br

Attachment: WPTAddict.pas
Description: Binary data



Please visit Addict Home Site.