--- a/src/jdict/DictIndex.java Mon Aug 13 23:57:15 2007 +0200
+++ b/src/jdict/DictIndex.java Sat Aug 18 23:18:41 2007 +0200
@@ -444,7 +444,11 @@
if (test == null)
break;
- if (test.startsWith(word))
+ boolean does_start_with;
+ does_start_with = test.startsWith(word);
+ System.out.println("Prefix linear comparing to " + test +
+ ": " + does_start_with);
+ if (does_start_with)
{
int offset = getOffset();
int length = getLength();
@@ -548,6 +552,7 @@
int pivot = top_index / 2;
int step = top_index / 2;
boolean found = false;
+ boolean found_laste = false;
String test;
/*
@@ -596,10 +601,8 @@
continue;
}
int comparision = word.compareTo(test);
- /*
- System.out.println("Comparing to " + bytesToString(test) +
+ System.out.println("Binary comparing to " + test +
": " + new Integer(comparision).toString());
- */
if (comparision <= 0)
{
/* If == 0, then we don't know that it is the
@@ -618,8 +621,10 @@
/* If we found the exact word in a non-last comparision,
* it's possible that the final binary search points us
* to the word PREVIOUS to the good match. */
- if (!word.startsWith(test))
+ if (!test.startsWith(word))
{
+ System.out.println("The word " + test +
+ " doesn't start with " + word);
readUntilNewLine();
}
else