diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-05-08 21:32:24 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-05-08 21:32:24 (GMT) |
commit | 23885c2f2db71f003578f0d1b44555c067bfd7a5 (patch) | |
tree | c4bbe961812e7008b9e85fd820596290c043c0f6 /src/search_php.h | |
parent | 5d31b7ab211586100301d6838be82f066f8f9af4 (diff) | |
download | Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.zip Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.tar.gz Doxygen-23885c2f2db71f003578f0d1b44555c067bfd7a5.tar.bz2 |
Release-1.4.2-20050508
Diffstat (limited to 'src/search_php.h')
-rw-r--r-- | src/search_php.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/search_php.h b/src/search_php.h index 86e97fa..04c95fe 100644 --- a/src/search_php.h +++ b/src/search_php.h @@ -21,24 +21,26 @@ "\n" "function computeIndex($word)\n" "{\n" -" $lword = strtolower($word);\n" -" $l = strlen($lword);\n" -" for ($i=0;$i<$l;$i++)\n" -" {\n" -" $c = ord($lword{$i});\n" -" $v = (($v & 0xfc00) ^ ($v << 6) ^ $c) & 0xffff;\n" -" }\n" -" return $v;\n" +" // Fast string hashing\n" +" //$lword = strtolower($word);\n" +" //$l = strlen($lword);\n" +" //for ($i=0;$i<$l;$i++)\n" +" //{\n" +" // $c = ord($lword{$i});\n" +" // $v = (($v & 0xfc00) ^ ($v << 6) ^ $c) & 0xffff;\n" +" //}\n" +" //return $v;\n" "\n" -" //if (strlen($word)<2) return -1;\n" +" // Simple hashing that allows for substring search\n" +" if (strlen($word)<2) return -1;\n" " // high char of the index\n" -" //$hi = ord($word{0});\n" -" //if ($hi==0) return -1;\n" +" $hi = ord($word{0});\n" +" if ($hi==0) return -1;\n" " // low char of the index\n" -" //$lo = ord($word{1});\n" -" //if ($lo==0) return -1;\n" +" $lo = ord($word{1});\n" +" if ($lo==0) return -1;\n" " // return index\n" -" //return $hi*256+$lo;\n" +" return $hi*256+$lo;\n" "}\n" "\n" "function search($file,$word,&$statsList)\n" @@ -48,7 +50,7 @@ " {\n" " fseek($file,$index*4+4); // 4 bytes per entry, skip header\n" " $index = readInt($file);\n" -" if ($index) // found words matching first two characters\n" +" if ($index) // found words matching the hash key\n" " {\n" " $start=sizeof($statsList);\n" " $count=$start;\n" |