Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Confused about Spellcheck dictionaries
Confused about Spellcheck dictionaries
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
PhilZombie
Blue Pill


Joined: May 16, 2007
Posts: 4

PostPosted: Thu Oct 18, 2007 4:38 am    Post subject: Confused about Spellcheck dictionaries

Hi there, since NeoOffice has supported the Mac native spellchecker, I have had trouble setting it up to work properly with New Zealand English.

I have installed the NZ list using the 'Add Dictionaries' wizard, but the 'available language modules' only lists the OSX spellchecker for 'Spelling' within English (New Zealand). And the spelling checking is only checking according to US spelling.

If I select English (Australian), then it works, but I don't see why I can't select the correct dictionary for my country.

What's the point of installing a localized dictionary if the OSX Spellchecker just over-rides it? Sorry if I'm not understanding properly here, but it seems that the native spell-checker has made things worse.
Back to top
Samwise
Captain Naiobi


Joined: Apr 25, 2006
Posts: 2315
Location: Montpellier, France

PostPosted: Thu Oct 18, 2007 4:56 am    Post subject:

Quote:
I have installed the NZ list using the 'Add Dictionaries' wizard, but the 'available language modules' only lists the OSX spellchecker for 'Spelling' within English (New Zealand).


"NeoOffice Mac OS X Spellchecker with Hunspell" will show up under whether NeoOffice is using the OS X spellchecker or Hunspell (the OpenOffice.org spellchecker).

Quote:
If I select English (Australian), then it works


Mac OS X has an Australian English dictionary. NeoOffice must be using that.

Quote:
I have installed the NZ list using the 'Add Dictionaries' wizard, but the 'available language modules' only lists the OSX spellchecker for 'Spelling' within English (New Zealand). And the spelling checking is only checking according to US spelling.

[…]

What's the point of installing a localized dictionary if the OSX Spellchecker just over-rides it?


It looks like because there is no New Zealand OS X dictionary, and because there is a partial match for English (New Zealand), NeoOffice is using OS X's U.S. English dictionary (the OS X spellchecker overrrides Hunspell whenever there is partial match for a locale in the OS X dictionary). Unfortunately, this is necessary to make the OS X spellchecker work.

You may be able, however, to install a third-party English (New Zealand) dictionary for the OS X spellchecker; if such a dictionary is present, NeoOffice will use it.
Back to top
PhilZombie
Blue Pill


Joined: May 16, 2007
Posts: 4

PostPosted: Thu Oct 18, 2007 3:15 pm    Post subject:

Thanks for you help, Samwise.

Alas, it appears there is no 3rd party NZ dictionary for OSX.

Is there any way I can map the 'English (New Zealand)' setting to use the Australian version of the OSX spell-checker instead of the default US?
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Tue Oct 23, 2007 10:30 am    Post subject:

A similar issue arises with using the certified Opentaal dictionary available in Openoffice format for the Dutch language. As was discussed on this forum
http://trinity.neooffice.org/modules.php?name=Forums&file=viewtopic&t=5045
it seems that there is no possibility to control the behaviour of Neooffice when it comes to selecting a specific dictionary to use for spell checking. For the languages for which Apple provides a dictionnary, you have no choice but to use them in Neooffice for spell checking (since you cannot uninstall them). Given the sub-par quality of the Apple-provided Dutch dictionary, this is a serious regression over version 2.1 of Neooffice.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 23, 2007 10:54 am    Post subject:

Gust wrote:
Given the sub-par quality of the Apple-provided Dutch dictionary, this is a serious regression over version 2.1 of Neooffice.


I feel for your woes, but it is the subpar installation and support of OOo for most every other language that caused us to abondon the OOo spellchecker and use the native Mac OS X spellchecker as the default.

Our purpose has always been to make OpenOffice.org as natively integrated with Mac OS X as we can afford to do. Integration with the native spellchecker is consistent with that goal. Flipping the order and putting the OOo spellcheckers (most of which are poorer quality and/or more crash prone that the native ones) is not.

I understand that there are some cases where certain dictionaries may be preferred over the native ones. Unfortunately, there are tradeoffs with tighter integration with the Mac OS X native environment and this is one of them.

If use of a dictionary that is not available through the Mac OS X spellchecking service is critical for your work, there are two options that are available for you at this point:

- Make (or pay someone to make) your preferred spellcheckers available native Mac OS X applications through Mac OS X spellchecking service extension mechanism like CocoASpell has done.

- Use the no cost option of doing your work in OpenOffice.org X11.

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Tue Oct 23, 2007 12:43 pm    Post subject:

pluby wrote:
If use of a dictionary that is not available through the Mac OS X spellchecking service is critical for your work, there are two options that are available for you at this point:

- Make (or pay someone to make) your preferred spellcheckers available native Mac OS X applications through Mac OS X spellchecking service extension mechanism like CocoASpell has done.

This is not a solution (as I already pointed out in the forum thread I made reference to). I do have a CocoASpell supported dictionary installed which is better than the Apple-provided one, but NeoOffice defaults to whatever Apple provides rather than anything else that is available through the Mac OS X spellchecking service. And I do not know of a way to remove Apple-provided dictionaries.
I do agree with the NeoOffice approach to integrate with Mac OS X as much as possible, but with respect to the spellchecking services the current implementation is incomplete. There are several situations where there is no unique match for a dictionary. Take the example of both Apple and CocoASpell providing a dictionary for the same language. Or the problem described by PhilZombie at the beginning of this thread, where the absence of a NZ English dictionary makes NeoOffice default to the US flavour of the (multiple) available EN dictionaries.
I'm not sure how to accommodate for these real problems. I think there should be somewhere a possibility to specify a choice in case there is not a unique hit between NeoOffice and the OS X provided dictionaries. And maybe also between the OS X provided ones and the OpenOffice/Hunspell ones, although this may not fit the NeoOffice integration approach.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 23, 2007 1:55 pm    Post subject:

The CocoASpell solution does work if you do it correctly when a unique locale is used. If, however, you register more than one dictionary to the same exact locale (for example, 2 separate dictionaries for nl), Mac OS X will always grab the first one registered.

Unfortunately, there is no API in Mac OS X to resolve this. The only place that Mac OS X allows you to resolve such a collision of multiple dictionaries registered to the same locale is in the native spellchecker dialog. From what I can tell, Mac OS X is using private APIs in this dialog to force a specific dictionary to be used.

With that said, I will take a second look at my code to see if there is a way to use the OOo dictionaries if there is no native Mac OS X dictionary available for a given locale (it appears that "nl" is the only Dutch locale in the default Mac OS X native spellchecker). Only if there is no native or OOo dictionary for a locale would I have the code use the language only native locale.

This would probably fix PhilZombie's issue. However, if the locale set in your document is one of the standard Mac OS X locale's or one that you has been added to the Mac OS X spellchecking service, you will still get the native spellchecker for that locale.

Assuming that I get the above implemented, here are the native locales supported by the native Mac OS X spellchecker. So, in PhilZombie's case, I should be able to make an OOo en_NZ dictionary work since there is no native one and, if PhilZombie deletes his en_NZ OOo dictionary, it would use the native "en" dictionary. In your case, assuming that you don't have a native "nl_nl" dictionary but have an OOo won, this approach should work since there is only a native "nl" dictionary. However, if you have added an "nl_nl" dictionary to the Mac OS X spellchecking service, you will still get the custom native nl_nl dictionary:

de
en
en_AU
en_CA
en_GB
en_US
en_ZA
es
fr
it
nl
pt
pt_BR
sv

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Tue Oct 23, 2007 2:28 pm    Post subject:

I am not sure if I understand it correctly, but I think the approach you are drafting would allow to overcome the problems described.

As for the case where the user adds a custom "nl_nl" dictionary to the OS X spellchecking service, this shouldn't be too problematic as it should be possible for the user to remove/disable it, e.g. CocoASpell provides a preference panel for enabling/disabling Aspell dictionaries. That said, the Aspell dictionary is a "nl" one (just as the Apple-provided dictionary), whereas the Opentaal Hunspell dictionary registers with OpenOffice/NeoOffice as "nl_nl". So no interference with respect to the language locales between the OS X spellchecking service and Hunspell.

B.t.w. is there an easy way to print out an overview of the locales that are registered with the OS X spellchecking?
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Tue Oct 23, 2007 2:57 pm    Post subject:

Gust wrote:
B.t.w. is there an easy way to print out an overview of the locales that are registered with the OS X spellchecking?


Not really. The list I put in my last post was using some test code that feeds each of the NeoOffice supported locales (these are the NeoOffice.app/Contents/Resources/*.lproj folders) into the Cocoa NSSpellchecker's set locale call and then printing the calls that succeeded.

Another not so obvious list is available by launching the TextEdit application, typing some text, Control-click on the text, and select Spelling :: Spelling from the popup menu. This will display the native spellchecker dialog and the languages list should give you an idea of what locales are registered. If there is no country in the language name, then it is likely that it is only using a language-only (e.g. "fr" or "nl") for that language.

Patrick
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Thu Oct 25, 2007 9:12 pm    Post subject:

I have implemented the change in logic described earlier in this topic and I have posted a test patch in bug 2686 that you can try.

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Sat Oct 27, 2007 8:55 am    Post subject:

Ok. I've commented in the bugreport.

As for the cocoAspell part of the story, I'm still trying to understand how it interacts with the OS X spellchecking services. I'll come back with some thoughts on the underlying dynamics when I have a better understanding.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sat Oct 27, 2007 9:13 am    Post subject:

Gust wrote:
As for the cocoAspell part of the story, I'm still trying to understand how it interacts with the OS X spellchecking services. I'll come back with some thoughts on the underlying dynamics when I have a better understanding.


I suspect that CocoASpell registers its dictionaries with a "variant" field in the locale. For example, they might create a Dutch locale that looks like "nl_nl.customdictionaryname".

I am not sure how you could test this theory since the list of locales within NeoOffice are hard-coded in NeoOffice's underlying OpenOffice.org code.

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Sun Oct 28, 2007 3:47 am    Post subject:

pluby wrote:
I suspect that CocoASpell registers its dictionaries with a "variant" field in the locale. For example, they might create a Dutch locale that looks like "nl_nl.customdictionaryname".

I am not sure how you could test this theory since the list of locales within NeoOffice are hard-coded in NeoOffice's underlying OpenOffice.org code.

There seems to be no Cocoa API that allows to define the (iso) standardised locale of a OS X spellchecking server, so at the level of the spellchecking services all dictionaries are defined with the custom (human readable) name that shows up in the spelling's panel pop-up list.

It is my understanding that for a limited number of locales os x knows the corresponding "human readable" language name. So when NeoOffice calls for such a locale, OS X tries to make the match at the level of the human readable name.

It's a pretty unconventional approach, but it does clarify why it's so fail-prone.
Back to top
pluby
The Architect
The Architect


Joined: Jun 16, 2003
Posts: 11949

PostPosted: Sun Oct 28, 2007 10:37 pm    Post subject:

FYI. I have added a big new change to the native spellchecker code in the latest test patch in bug 2686.

In this test patch, if there is a "language only" native Mac OS X dictionary and OOo lists a locale with that same language and there is no matching native or OOo dictionary for the locale, the matching "language only" native Mac OS X dictionary will be used for that locale.

For example, there is a native "fr" Mac OS X dictionary and NeoOffice lists "fr_CA" as on option in in the Tools :: Options :: Language Settings :: Languages panel. If there is no native or OOo "fr_CA" dictionary installed, French (Canada) will show as having a dictionary and, if you document is set to that locale, the "fr" native Mac OS X dictionary will be used.

I understand that there will be cases where users might be confused when they see American English spellchecking occurring when they have English (India) or similar cases, but I believe that is better than the current situation in which it seems that the spellchecker doesn't work.

Patrick
Back to top
Gust
Councilperson


Joined: Oct 09, 2007
Posts: 137

PostPosted: Mon Oct 29, 2007 3:24 am    Post subject:

pluby wrote:
FYI. I have added a big new change to the native spellchecker code in the latest test patch in bug 2686.

I've commented in the bugreport.
pluby wrote:
In this test patch, if there is a "language only" native Mac OS X dictionary and OOo lists a locale with that same language and there is no matching native or OOo dictionary for the locale, the matching "language only" native Mac OS X dictionary will be used for that locale.

For example, there is a native "fr" Mac OS X dictionary and NeoOffice lists "fr_CA" as on option in in the Tools :: Options :: Language Settings :: Languages panel. If there is no native or OOo "fr_CA" dictionary installed, French (Canada) will show as having a dictionary and, if you document is set to that locale, the "fr" native Mac OS X dictionary will be used.

So if I understand it correctly, NeoOffice looks for an available dictionary for the fictitious language "ab_cd" in the following places (and in that order):
  1. Is "ab_cd" available with the OS X spellchecking services?
  2. Is "ab_cd" provided as a OpenOffice Hunspell dictionary?
  3. Is "ab" available with the OS X spellchecking services?

Such behaviour seems pretty intuitive as to my opinion.
pluby wrote:
I understand that there will be cases where users might be confused when they see American English spellchecking occurring when they have English (India) or similar cases, but I believe that is better than the current situation in which it seems that the spellchecker doesn't work.

This is not a real regression over the original behaviour of NeoOffice 2.2.1 where no spell checking would occur. And in the improved behaviour, there is a straightforward workaround for such a situation:
  • if there is a OpenOffice Hunspell dictionary available for English (India), install it in NeoOffice;
  • if there is no OpenOffice Hunspell dictionary available, switch of spell checking in NeoOffice.

Note that also for the case where users are confused by NeoOffice not using the OS X spellchecking services for language "ab" (because a "ab_cd" dictionary is part of the default install of NeoOffice), a workaround is available by removing the "ab_cd" line from the dictionary.lst file. Ok, this one is less straightforward, but at least a real workaround does exist. Maybe someone should document this in the wiki by the time the patch is released in the wild.

So it is my opinion that the big new change is a big new improvement. Very Happy
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Goto page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.