Am 09.05.2011 um 15:22 schrieb Uwe Stöhr:

> Am 09.05.2011 14:45, schrieb Stephan Witt:
> 
>> Besides the question how to install hunspell I have a remark here.
>> 
>> Aspell in general is unable to remove words from the personal word list.
> 
> Yes, this is one of the major problems of Aspell.
> 
>> That's why I've implemented the personal word list as a feature of LyX.
>> The new personal word lists of LyX 2.0 are common to all backends.
>> Nevertheless the installed Aspell may have its own PWL.
> 
> Yes, it has.
> 
>> Since these are "write-only" they are used like system dictionaries.
>> However, if you add a word to your personal dictionary in LyX 2.0,
>> you'll see them both is hunspell and Aspell. OTOH, you won't see
>> them in other tools using Aspell.
> 
> How can I add the word list from my pwl to the LyX word list?
> It would be great if we could implement in the installer, that Aspell word 
> lists are added to the LyX word list.

The Aspell format is (AFAIK):
1 file per language (e. g. $HOME/.aspell.en.pwl or $HOME/.aspell.de-alt.pwl)
Every file has:
1 header line (containing format, language and count of items) and
n lines per word (char set is the current one, aka undefined)

The LyX format is:
1 file per language as of - FileName dictfile = 
FileName(addName(package().user_support().absFileName(),"pwl_" + lang.lang() + 
".dict"))
 at my machine that's e. g. "/Users/stephan/Library/Application 
Support/LyX-2.0/pwl_english.dict"
1 header line with the fixed string "# personal word list"
n lines per word (char set is utf-8)

So the task would have the following sub-tasks:
1. iterate the personal word lists the user has (for all languages)
2. detect the appropriate char set
3. look up the LyX language name from lib/languages
 LangCode => Language, e. g. LangCode=pt_BR => Language brazilian
4. create the word list file with the fixed header line and copy the contents 
with char set conversion

Stephan

Reply via email to