Home » U++ Library support » RichText,QTF,RTF... » Spell checking on linux
Re: Spell checking on linux [message #26614 is a reply to message #26322] |
Sun, 16 May 2010 00:17 |
|
Hi,
Here are the dictionaries, together with the original sources. Can someone put them to sf.net? Or I can do it myself, if someone grants me the rights (my sf.net account is dolik_rce).
Also, I propose to make a little change to the function finding the files: Speller *sGetSpeller(int lang)
{
static ArrayMap<int, Speller> speller;
int q = speller.Find(lang);
if(q < 0) {
String pp;
String dir = ConfigFile("scd");
for(;;) {
pp << dir << ';';
String d = GetFileFolder(dir);
if(d == dir) break;
dir = d;
}
pp << spell_path << ';' << getenv("LIB") << ';' << getenv("PATH") << ';';
String path = GetFileOnPath(ToLower(LNGAsText(lang)) + ".udc", pp);
if(IsNull(path))
path = GetFileOnPath(ToLower(LNGAsText(lang)) + ".scd", pp);
if(IsNull(path)) // This is
path = GetFileOnPath(ToLower(LNGAsText(lang).Left(2)) + ".udc", pp); // added
if(IsNull(path))
return false;
FileIn in(path);
if(!in)
return false;
... It will allow the dictionaries to have just the language part of name (i.e. no country code). This way, even if the user selects country which does not have specific dictionary yet (e.g. EN-NZ) he still gets a spell checker for given language (that is en.udc for the New Zealand exmple). IMHO it is better to serve a more general dictionary than nothing.
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Mon Jun 10 08:23:09 CEST 2024
Total time taken to generate the page: 0.01907 seconds
|