lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jxf jxf" <djsoft....@gmail.com>
Subject String Comparing Problem
Date Sun, 11 Jun 2006 09:22:40 GMT
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.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message