Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi Tommy,

On 2012-01-06 at 08:52 +0100, Tommy wrote:

there's however the vast majority of words that have exactly the same
spelling... let's take an example: “yellow” which is the same in England,  
USA,
South Africa, Australia, Canada etc. etc.

if you come with a typing error like “yrllow” you should set an autocorrect
entry in each of the localized english .dat files... it would be too time
consuming...

It would be much user friendly and time saving to have a “non localized”  
acor-
en.dat file whose entries are shared by all english subtypes.

I'm not asking to merge the GB and US acor.dat files...
I'm asking to add an additional “non localized” database.

This would have the advantage to handle autocorrection of the vast  
majority of
common spelling english words regardless of the regional language subtype  
of
documents.

The code you want to play with is editeng/source/misc/svxacorr.cxx .

You probably want to tweak SvxAutoCorrect::SearchWordsInList() so that
it fallbacks to 'en' in case the word is not found in 'en_US', or
something like that; but you will have to tweak some code around that
probably too, in order to load the shared acor_XY.dat in addition to
acor_XY_AB.dat, etc.

I don't think it is hard; but some constructs used in that piece of code
are not too obvious, my favorite is this condition:

    else if( ( FStatHelper::IsDocument( sUserDirFile ) ||
                FStatHelper::IsDocument( sShareDirFile =
                              GetAutoCorrFileName( eLang, sal_False, sal_False ) ) ) ||
        ( sShareDirFile = sUserDirFile, bNewFile ))

Regards,
Kendy


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.