• Welcome to DictionaryForMids Forum.
 

how to make the translation search case (in-)sensitive

Started by Ortho_Normal, 01. September 2010, 16:22:58

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ortho_Normal

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.

dreamingsky

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

Gert

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

dreamingsky

Excellent, I'll add NormationEng to the dictionary and upload a new version this weekend.

Jeff

Gert


dreamingsky