On 17.12.2015, at 17:17, Daniel Naber <daniel.na...@languagetool.org> wrote:
> 
> On 2015-12-16 23:33, Richard Eckart de Castilho wrote:
> 
>> Personally, I like the method where I can pass a language code as a 
>> String
>> and get back the proper language:
>> 
>>  Languages.getLanguageForShortName(langCode)
>> 
>> Wouldn't it be reasonable to discourage directly constructing languages
>> in favor of using a central factory class like Languages?
> 
> Maybe... but it doesn't solve this very problem, as users then call 
> getLanguageForShortName("de") and also wonder why they don't get spell 
> checking. They need to call getLanguageForShortName("de-DE") for that.

You know what... now I understand why one guy trying to use the 
LT spell checker in DKPro Core reported problem in getting spelling
corrections:

https://groups.google.com/d/msg/dkpro-core-user/BydqkdBjqMM/dkFw5PYUx1UJ

We use the two-letter codes everywhere!

How about doing a built-in default mapping for the two-letter codes to, e.g.
"de" -> "de-DE", "pt" -> "pt-PT" (I can already see Brazilians to argue for
"pt-BR" ;) ) etc?

Cheers,

-- Richard

------------------------------------------------------------------------------
_______________________________________________
Languagetool-devel mailing list
Languagetool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-devel

Reply via email to