Home » U++ Library support » RichText,QTF,RTF... » Speller routine
Speller routine [message #56003] |
Mon, 11 January 2021 15:10  |
BetoValle
Messages: 204 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
when the user activates spellcheck in the RichEdit editor, depending on the configured language, the system searches for the .udc file.
The point is that here in my country, from time to time, the dictionary grows.
In this way it is necessary (in my case) that the user can have access (in a friendly way) to the words in this dictionary.
(in my delphi applications I used it in the component editor trichedit / www.trichview.com / to update the custom dictionary that was loaded from an editable database).
(a) Is there a structure defined in U ++ / RichEdit allowing the dictionary to be editable?
(b) What is the internal structure of a .udc file (probably compressed)? (I think this would be the easiest way to adapt).
Thanks!
|
|
|
|
|
|
Re: Speller routine [message #56086 is a reply to message #56085] |
Fri, 22 January 2021 14:23  |
BetoValle
Messages: 204 Registered: September 2020 Location: Brasil Valinhos SP
|
Experienced Member |
|
|
Hi
I created a file pt_br.usp containing words that the file pt_br.udc did not contemplate, I put it in the root of the application and it works. So in topic (a) by the written sources it allows this functionality. In the file pt_br.usp, it makes no sense for me to write
a variation of the same word ... example:
anything
anyTHING
Anything ... etc ...
To solve this, inside the function "spellWordRaw" (Speller.cpp) every line containing "return f-> user.Find (wrd)> = 0" could be replaced by the return of a function below "return SpellWordRawMeu( f,wrd);" :
bool SpellWordRawMeu( Speller *f, const WString& wrd ){
String t1 = ToUtf8(wrd);
String t2 = ToUtf8(ToLower(wrd));
WString w1 =t1.ToWString();
WString w2 =t2.ToWString();
boolean b1 = f->user.Find(w1) >= 0;
boolean b2 = f->user.Find(w2) >= 0;
if(b1 || b2){
return true;
}else{
return false;
}
}
in preliminary tests, it worked!
So, in order not to disturb the others written in the code that already works, externally, the user of my country could keep the file with udc extension without content, and create a partial file with usp extension, with all lowercase words (the which is not difficult to get here / I already did this to test). So a routine can easily be written into a routine for the user to update the usp file if necessary.
I searched on google about MakeSpellScd, but the only 2 references fall into the discussion where you already know.
Thanks
|
|
|
Goto Forum:
Current Time: Sun May 11 01:34:48 CEST 2025
Total time taken to generate the page: 0.03307 seconds
|