Bram Moolenaar wrote:

> Dominique Pelle wrote:
>
>> Attached patch adds the AAP files to build the Breton dictionary for Vim
>> in utf-8 and latin1 encoding from the OpenOffice-3.x Breton dictionary.
>>
>> Breton (Brezhoneg, language code "br") is a Celtic language spoken in
>> Brittany (west of France) which is closely related to Cornish and Welsh
>> For more information about Breton, see:
>>   http://en.wikipedia.org/wiki/Breton_language
>
> Thanks.  I'll have a look soon.  Would the same method work for other
> languages and OpenOffice-3 spell files?

OpenOffice-3 spell file works well at least for the Breton dictionary.
I've tested it fairly well.

I'll give it a try with other languages, but I've just noticed already that the
OpenOffice-3.x Esperanto dictionary does not work whereas the OpenOffice-2.x
one works well. ":mkspell! /tmp/eo eo_ilo" gives errors:

Reading affix file eo_ilo.aff ...
Unrecognized or duplicate item in eo_ilo.aff line 22: LANG
Invalid value for FLAG in eo_ilo.aff line 25: UTF-8
Unrecognized or duplicate item in eo_ilo.aff line 27: WORDCHARS
Unrecognized or duplicate item in eo_ilo.aff line 28: KEY
Unrecognized or duplicate item in eo_ilo.aff line 31: BREAK
Unrecognized or duplicate item in eo_ilo.aff line 32: BREAK
Unrecognized or duplicate item in eo_ilo.aff line 33: BREAK

... and the output Vim dictionary eo.utf-8.spl contains some garbage
words with numbers (looking at output of ":spelldump") for example:

a-vort0oj
a-vort0ojn
a-vort0on

>> One odd thing which I did not understand: I had to put "set spell"
>> in vim/runtime/spell/br/main.aap at line 19 or else the generated
>> br.utf-8.spl was somehow incorrect?!  Why? The incorrect br.utf-8/spl
>> gave error: "E763: Word characters differ between spell files"  when
>> trying to use it. Somehow the "set spell" in main.aap fixes it.
>
> I think that's because of the way word characters are recognized.  This
> is tricky especially for when it's not 100% clear what punctuation
> characters are.  E.g. a "-" usually isn't.  This information is stored
> in the spell file to be able to check that it works.

I see that the Breton dictionary is not the only one giving E763.
The Welsh dictionary (cy.utf-8.spl) also gives the same error when
trying to use it

The value of i at spell.c:9946 where E763 is given is 181,
spelltab.st_fold[i] is 181 which is different than new_st->st_fold[i] (188)

According to http://en.wikipedia.org/wiki/Latin1#ISO-8859-1
181 is Micro sign and 188 is the 1/4 sign.

Maybe I have to add FOL/LOW/UPP in the .aff file.  The Breton
and Welsh .aff files don't have them

In any case, putting "set spell" before running "mkspell!" in main.aap
avoids the E763 error. I'll spend more time on it later.

Cheers
-- Dominique

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

To unsubscribe, reply using "remove me" as the subject.

Raspunde prin e-mail lui