DictionaryForMids Forum

DictionaryForMIDs for Mobiles (Java ME; most devices from Nokia, Samsungs, RIM (Blackberry), LG, SonyEricsson, Motorola and plenty more) => Problems => Topic started by: Ortho_Normal on 01. September 2010, 16:22:58

Title: how to make the translation search case (in-)sensitive
Post by: Ortho_Normal on 01. September 2010, 16:22:58
Hi,
I am running DfM 3.5.7 (and 3.4.0) dictionaries on a Symbian S40 6th Edition phone (Nokia 2710 Navigation Edition - MIDP 2.1, CLDC 1.1).

I have found that in some cases DfM finds words only if I write the word using exactly the same case as present in the dictionary. I did not find any option to switch between "case sensitive" and "case insensitive" search. Could you, please, implement such an option?

The example of such a dictionary with this problems is "DictionaryForMIDs_3.4.0_Elements.zip". If I try to find "Carbon" (big "C" in the beginning) it finds nothing, but if I try "carbon" (small "c" in the beginning) I get the definition.

Thanks in advance,
Best regards,
Ortho Normal.
Title: Re: how to make the translation search case (in-)sensitive
Post by: dreamingsky on 01. September 2010, 17:10:14
Gert

The Chemical Elements dictionary uses this for the UpdateClasses:

language1DictionaryUpdateClassName: de.kugihan.dictionaryformids.dictgen.dictionaryupdate.DictionaryUpdateEngDef
language2DictionaryUpdateClassName: de.kugihan.dictionaryformids.dictgen.dictionaryupdate.DictionaryUpdatePartialIndex

The carbon search will come from language1.  I can add this:
language1NormationClassName: de.kugihan.dictionaryformids.translation.normation.NormationEng

Will NormationEng only change Carbon -> carbon?  Will it also change carbon -> Carbon?

I can now remove DictionaryUpdatePartialIndex since it is used as the default now.

Jeff
Title: Re: how to make the translation search case (in-)sensitive
Post by: Gert on 03. September 2010, 06:16:26
Jeff,

QuoteWill NormationEng only change Carbon -> carbon?  Will it also change carbon -> Carbon?
Both will work; actually NormationEng will not change the dictionary entry itself (i.e. the dictionary content remains untouched). NormationEng (as the other Normation classes) is only used for determining if a dictionary entry is a hit.  [yes ... you knew this already ;) ]

In NormationEng there is a call to NormationLib.defaultNormation which in turn calls Util.convertToLowerCase.

That means that when DfM determines whether a dictionary entry is a hit, then
1. DfM converts both the dictionary entry and the user input to lower case characters
2. if lower case dictionary and lower case user input match, then the dictionary entry is a hit


Thanks !!
Gert
Title: Re: how to make the translation search case (in-)sensitive
Post by: dreamingsky on 03. September 2010, 17:05:12
Excellent, I'll add NormationEng to the dictionary and upload a new version this weekend.

Jeff
Title: Re: how to make the translation search case (in-)sensitive
Post by: Gert on 03. September 2010, 18:26:11
Great !

Gert
Title: Re: how to make the translation search case (in-)sensitive
Post by: dreamingsky on 06. September 2010, 10:24:20
I uploaded a new version of the dictionary.

Jeff