Is the logic in NumericLabelFilter.isNumeric correct ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Is the logic in NumericLabelFilter.isNumeric correct ?

Tom Pines
Hello,

NumericLabelFilter.isNumeric returns true for type TT_BARE_URL.

    private final boolean isNumeric(int type)
    {
        return (type & ITokenType.TT_NUMERIC) != 0;
    }

Should it be something like the following instead ?

return (type & ITokenType.TYPE_MASK) == ITokenType.TT_NUMERIC;

Thanks,
Tom
Reply | Threaded
Open this post in threaded view
|

Re: Is the logic in NumericLabelFilter.isNumeric correct ?

Stanislaw Osinski
Administrator
Hi Tom,

NumericLabelFilter.isNumeric returns true for type TT_BARE_URL.

   private final boolean isNumeric(int type)
   {
       return (type & ITokenType.TT_NUMERIC) != 0;
   }

Should it be something like the following instead ?

return (type & ITokenType.TYPE_MASK) == ITokenType.TT_NUMERIC;

Ooops, your right, Tom. I've just committed the fix you suggested, plus a better unit test. When the build passes, the bug fix should be available in the 3.3.0-dev binaries at: http://download.carrot2.org/head/.

Thanks!

S.


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Carrot2-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/carrot2-developers