You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by jxf jxf <dj...@gmail.com> on 2006/06/11 11:22:40 UTC

String Comparing Problem

In Index\SegmentTermVector.cs line 83

Array.BinarySearch( method by default use the System.IComparable to compare
the two objects, here
string.Compare( will be called, but actually it is the method
string.CompareOrdinal( which should be called I
guess.
Because the term text string[] is sorted in the ASCII order which means
lower case characters are bigger than all Capital ones.

example:

string[] sTermText =
new string[]{"Clear","atom","basic","cat","dog"};

int res = Array.BinarySearch( sTermText, "Clear" );

// res < 0, it is obviously wrong in this case.