Thanks Loic, you seem to have stumbled on a bug.

#3 below, the problem is here:
>
>         if (mMetaDictionary.contains(token)) {
>
This is in the find() function for the DictionaryNameFinder.

Unfortunately, this check is checking for case when it looks for the
containing token.

Jorn, ...
This class seems to be creating another MetaDictionary to filter the
input, could this be handled by the original dictionary.  This
MetaDictionary, doesn't seem to do much than re-index the tokens of the
original dictionary....

Is it okay to rework this to fix the case sensitivity?

James

On 12/20/2011 8:38 AM, Loic Descotte wrote:
> Hello,
> I'm trying to use OpenNLP Dictionary and DictionaryNameFinder to do a
> dictionnary lookup.
>
> I'm building my dictionary with the DictionarySerializer class.
> My dictionary contains entries with attributes.
>
> Example :
>
> <dictionary case_sensitive="false">
> <entry ref="cheese">
>    <token>cheddar</token>
> </entry>
> <entry ref="vegetable">
>    <token>tomato</token>
> </entry>
> </dictionary>
>
>
> The keyword lookup is working but there are things I don't know how to
> do.
>
> 1.
> When I find a token in a text , I get a list of Span objects :
>
> Span[] spans = finder.find(tokenizedText);
>
> I don't know how to retrieve the found token attributes:
> For example, if I find "tomato", I would like to be able to retrieve
> the "ref" attribute (vegetable).
>
> 2.
> If in my dictionary I want to find a composed name (e.g. green
> cabbage) , I am able to find "green", "cabage", but not "green
> cabbage". Is there a special way to insert composed names in the
> dictionary?
>
> 3. I've set my dictionnary to "case_sensitive="false" " but if there
> is "Tomato" in my text, then "tomato" will not be found.
>
> Thanks a lot for your help
>
> -- 
> Loic
>
> ________________________________
> Kelkoo SAS
> Société par Actions Simplifiée
> Au capital de € 4.168.964,30
> Siège social : 8, rue du Sentier 75002 Paris
> 425 093 069 RCS Paris
>
> Ce message et les pièces jointes sont confidentiels et établis à
> l'attention exclusive de leurs destinataires. Si vous n'êtes pas le
> destinataire de ce message, merci de le détruire et d'en avertir
> l'expéditeur.
>

Reply via email to