Menu

#23 String Comparing Problem

open
nobody
None
5
2013-01-10
2006-02-21
Anonymous
No

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.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB