Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » Speller routine
Speller routine [message #56003] Mon, 11 January 2021 15:10 Go to next message
BetoValle is currently offline  BetoValle
Messages: 202
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 #56008 is a reply to message #56003] Tue, 12 January 2021 20:27 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member

Could someone give me a light? thanks
Re: Speller routine [message #56011 is a reply to message #56008] Wed, 13 January 2021 14:14 Go to previous messageGo to next message
BetoValle is currently offline  BetoValle
Messages: 202
Registered: September 2020
Location: Brasil Valinhos SP
Experienced Member
There is a situation to expand the dictionary, which is to create a file similar to that of spell (.udc), but with the extension ".usp" saved inside the application folder, where new words are added (edit a text file where each new word is on a line). After this addition, the user will have to close the application to reestablish this update.
Couldn't a routine be created in this situation to read the '.usp' file again as a "SpellerRefresh"? So it would not be necessary to close and load the program again (I don't know how to do this, because the structure is complex ... Maybe someone from there with good will can do it).
Well as I understand it, there is a lack of a routine to remove from the '.udc' file, the words that are eventually discarded by an orthographic reform (this exists!)
Re: Speller routine [message #56085 is a reply to message #56003] Fri, 22 January 2021 13:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
BetoValle wrote on Mon, 11 January 2021 15:10
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!


a) no
b) uppbox/MakeSpellScd Despite the name, this produces .udc format...
Re: Speller routine [message #56086 is a reply to message #56085] Fri, 22 January 2021 14:23 Go to previous message
BetoValle is currently offline  BetoValle
Messages: 202
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
Previous Topic: Report Perform() and printing
Next Topic: search in Report
Goto Forum:
  


Current Time: Fri Mar 29 00:02:11 CET 2024

Total time taken to generate the page: 0.01013 seconds