[Solved] More than one dictionary file in a dic extension

Discuss setup / installation issues - Add a spell checker, Language pack?
Post Reply
DavidePrina
Posts: 10
Joined: Sat Dec 01, 2007 12:17 pm
Location: Italy

[Solved] More than one dictionary file in a dic extension

Post by DavidePrina »

I have created a dictionary extension for the Italian language:
http://extensions.services.openoffice.o ... Dict_it_IT

This extension contain the primary orthographic dictionary for Italian language.

Actually there is one secondary dictionary: the Italian surname dictionary. You can find it here (it is not an extension):
http://linguistico.sf.net/wiki/doku.php ... i_italiani

I'm try to create an extension for installing also this secondary dictionary, but I'm unable to make it.
For my test I'm using Debian Lenny GNU/Linux with OOo 3.0 rc.3

here is the dictionaries.xcu file I have created:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Linguistic" oor:package="org.openoffice.Office">
 <node oor:name="ServiceManager">
    <node oor:name="Dictionaries">
        <node oor:name="HunSpellDic_it-IT-cognome" oor:op="fuse">
            <prop oor:name="Locations" oor:type="oor:string-list">
                <value>%origin%/it_IT/it_IT_cognome.aff %origin%/it_IT/it_IT_cognome.dic</value>
            </prop>
            <prop oor:name="Format" oor:type="xs:string">
                <value>DICT_SPELL</value>
            </prop>
            <prop oor:name="Locales" oor:type="oor:string-list">
                <value>it_IT</value>
            </prop>
        </node>
    </node>
 </node>
</oor:component-data>
I have used the "HunSpellDic_it-IT-cognome" name because if I use the "HunSpellDic_it-IT" one, the primary dictionary is removed from the Linguistic.xcu file located at:
~/.openoffice.org/3/user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/registry/data/org/openoffice/Office
I never been able to make the surname dictionary working.

I'm thinking this is a defect of the new dictionaries system (I'm not sure because I haven't found a manual for the dictionaries.xcu file).
With the dictionary.lst (OOo 2.0) you can use secondary dictionary as:

Code: Select all

DICT it IT it_IT
DICT it IT it_IT_cognome
I'm building also others secondary dictionaries for Italian language ...

Probably I will open also an issue for this defect.

Ciao
Davide
Last edited by DavidePrina on Tue Oct 07, 2008 9:18 pm, edited 2 times in total.
DavidePrina
Posts: 10
Joined: Sat Dec 01, 2007 12:17 pm
Location: Italy

Re: How to create a dictionary extension for a second dictionary

Post by DavidePrina »

I have now found this:
http://wiki.services.openoffice.org/wik ... ctionaries
where you can read:
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----
You must have at most one dictionary of any type for each language in your extension!
That is only one for each format DICT_SPELL, DICT_HYPH, DICT_THES per locale.
Otherwise, if for example you have two different spelling dictionaries with different content, they will all be used at the same time(!), which is most likely not want you want. And thus you have taken away the choice for the user.
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----

so they do not have managed secondary dictionaries :-(

Ciao
Davide
User avatar
Hagar Delest
Moderator
Posts: 32654
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to create a dictionary extension for a second dictionary

Post by Hagar Delest »

I've moved your thread to the Setup & troubleshouting forum because Code snippets is not for questions (see its rules).

In the dictionary.xcu file, you had added the code above to the existing one for your first dic? Anyway, it just means that you'll need a second extension, not that illogical.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
DavidePrina
Posts: 10
Joined: Sat Dec 01, 2007 12:17 pm
Location: Italy

Re: How to create a dictionary extension for a second dictionary

Post by DavidePrina »

Hagar de l'Est wrote:I've moved your thread to the Setup & troubleshouting forum because Code snippets is not for questions (see its rules).
sorry
In the dictionary.xcu file, you had added the code above to the existing one for your first dic? Anyway, it just means that you'll need a second extension, not that illogical.
it is impossible to have more than one dictionary for locale ... read my second post.

Please people vote this issue ... if you think that secondary dictionaries are very important:
http://www.openoffice.org/issues/show_bug.cgi?id=94642

Ciao
Davide
User avatar
Hagar Delest
Moderator
Posts: 32654
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to create a dictionary extension for a second dictionary

Post by Hagar Delest »

I've read your second post and even the wiki and it doesn't say explicitly that you can't do it.

I tried to install your extension and activating the other files (cognome) only, having placed the right files in the extension of course and it doesn't seem to recognize all the words. For example if I write Aamot, OOo says it's misspelled and propose Amato. But Aamot is in the cognome file. Am I missing something? If so, what word can I type so that it should be recognized in the cognome dictionary?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
DavidePrina
Posts: 10
Joined: Sat Dec 01, 2007 12:17 pm
Location: Italy

Re: How to create a dictionary extension for a second dictionary

Post by DavidePrina »

Hagar de l'Est wrote:I've read your second post and even the wiki and it doesn't say explicitly that you can't do it.
it say you cannot use more than one dictionary for a single locale:
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--
What you must not do!
You must have at most one dictionary of any type for each language in your extension!
That is only one for each format DICT_SPELL, DICT_HYPH, DICT_THES per locale.
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<--

so you can only install or the it_IT or the it_IT_cognome, but the second is useless if you don't have the first.
I tried to install your extension and activating the other files (cognome) only, having placed the right files in the extension of course and it doesn't seem to recognize all the words. For example if I write Aamot, OOo says it's misspelled and propose Amato. But Aamot is in the cognome file. Am I missing something? If so, what word can I type so that it should be recognized in the cognome dictionary?
My surname: Prina

I have try for more day to install the surname dictionary with the Italian dictionary ... and I have failed all the time. I have also try to modify the Linguistic.xcu file ...

Ciao
Davide
User avatar
Hagar Delest
Moderator
Posts: 32654
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to create a dictionary extension for a second dictionary

Post by Hagar Delest »

That is only one for each format DICT_SPELL, DICT_HYPH, DICT_THES per locale.

Otherwise, if for example you have two different spelling dictionaries with different content, they will all be used at the same time(!), which is most likely not want you want. And thus you have taken away the choice for the user.
So it implies that you still can do it. Remember that they have changed the way the dics are managed, not the way it works I think. So it's just a rule.

I tried with 'Prina' and it's not recognize by the cognome dic.
Edit: wait, it works, I'd to restart OOo. Let me check if I can add the standard IT file.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Hagar Delest
Moderator
Posts: 32654
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to create a dictionary extension for a second dictionary

Post by Hagar Delest »

OK, I tried different schemes (adding a locations line and duplicating the whole dic node) and indeed, it doesn't work. You should change the component of your issue from 'Word processor' to 'Lingucomponent'. I would vote for it right away (no vote left for Writer). That's indeed a limitation since you'll have to bundle all the possibilities in different extensions.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
DavidePrina
Posts: 10
Joined: Sat Dec 01, 2007 12:17 pm
Location: Italy

Re: How to create a dictionary extension for a second dictionary

Post by DavidePrina »

Hi Hagar de l'Est,
Hagar de l'Est wrote:OK, I tried different schemes (adding a locations line and duplicating the whole dic node) and indeed, it doesn't work.
many thanks for your support and testing
You should change the component of your issue from 'Word processor' to 'Lingucomponent'. I would vote for it right away (no vote left for Writer).
sorry for this mistake also :-(
now the issue have 13 votes and if I change to "Lingucomponent" all the people must vote again ...
I think that I do not change and wait for comment by OOo programmers ... if they comment.
If you cannot vote ... you can add a comment ;-)
That's indeed a limitation since you'll have to bundle all the possibilities in different extensions.
yes this is a very bad thing. I think a lot of Italian people will rest with OOo 2.x because they can't use the surnames dictionary.
The surnames is the most correct words that is see as wrong and they can obscurity the real wrong words. Else if you can see all surname (or nearly all) as correct words, you can see more easy the "real" wrong words ... and if you mistake in writing a surname you see this mistake as wrong word (you don't think: this surname is not in the dictionary).

Ciao
Davide
User avatar
Hagar Delest
Moderator
Posts: 32654
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to create a dictionary extension for a second dictionary

Post by Hagar Delest »

DavidePrina wrote:if I change to "Lingucomponent" all the people must vote again ...
No, don't worry, no impact on the votes.

BTW, I've changed the thread title to a more explicit one I hope it will draw the attention better.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
DavidePrina
Posts: 10
Joined: Sat Dec 01, 2007 12:17 pm
Location: Italy

Re: [Issue] More than one dictionary file in a dic extension

Post by DavidePrina »

DavidePrina wrote: [...]

Code: Select all

[...]
                <value>it_IT</value>
[...]
I have make a mistake.
the right code must be:

Code: Select all

[...]
                <value>it-IT</value>
[...]
I'm very sorry for trouble you.

Many thanks for all your support.
I will issue the surname dictionary extension in the next days

Ciao
Davide
Post Reply