shuusei24109:2バイト文字のキーワードに対応

diff --dos -wurN 24108/constants.pas 24109/constants.pas
--- 24108/constants.pas	Fri Jan 24 03:16:12 2003
+++ 24109/constants.pas	Tue Jan 28 15:09:44 2003
@@ -91,7 +91,7 @@
  KEYWORD_MAX_SEARCH           = 8; // maximum keywords in search query
  MAX_KEYWORD_ITEMS            = 8000; // limit of items in one keyword. all items exceeding this limit won't be skipped - this limit makes sence only if keyword was selected as base keyword for search
  KEYWORDS_FIRST               = '!&0123456789@abcdefghijklmnopqrstuvwxyz'; // list of characters that can be first item of keyword
- KEYWORDS_FIRST_COUNT         = 39; // number of items in KEYWORDS_FIRST list
+ KEYWORDS_FIRST_COUNT         = 40;//# of KEYWORDS_FIRST+1(for 2byte char)// 39; // number of items in KEYWORDS_FIRST list
  KEYWORDS_SEPARATORS          = #$00#$01#$02#$03#$04#$05#$06#$07#$08#$09#$0A#$0B#$0C#$0D#$0E#$0F+
                                 #$10#$11#$12#$13#$14#$15#$16#$17#$18#$19#$1A#$1B#$1C#$1D#$1E#$1F+
                                 #$20'"'#39'()*+,-./:;<=>?[\]_`'; // list of whitespaces. keyword ends as soon as any of these characters is found.
diff --dos -wurN 24108/keywords.pas 24109/keywords.pas
--- 24108/keywords.pas	Tue Jan 28 13:27:02 2003
+++ 24109/keywords.pas	Tue Jan 28 16:05:02 2003
@@ -63,7 +63,8 @@
    c:=str[i];
    if spacing then
    begin // searching for beginning of keyword
-     if pos(c,KEYWORDS_FIRST)>0 then // found our first keyword character
+//     if pos(c,KEYWORDS_FIRST)>0 then // found our first keyword character
+     if pos(c,KEYWORDS_SEPARATORS)=0 then // found our first keyword character
      begin
        start:=i;
        spacing:=false;
@@ -72,6 +73,7 @@
    else
    begin // searching for end of keyword
      if pos(c,KEYWORDS_SEPARATORS)>0 then // found spacing
+     if not (ByteType(str,i)=mbTrailByte) then
      begin
        spacing:=true;
        count:=i-start;
@@ -111,7 +113,8 @@
    c:=inc_str[i]; 
    if spacing then 
    begin // searching for beginning of keyword 
-     if pos(c,KEYWORDS_FIRST)>0 then // found our first keyword character 
+//     if pos(c,KEYWORDS_FIRST)>0 then // found our first keyword character
+     if pos(c,KEYWORDS_SEPARATORS)=0 then // found our first keyword character
      begin 
        start:=i; 
        spacing:=false; 
@@ -134,6 +137,7 @@
      last_exc:=false; 
      hardspacing:=false; 
      if pos(c,KEYWORDS_SEPARATORS)>0 then // found spacing 
+     if not (ByteType(inc_str,i)=mbTrailByte) then
      begin 
        spacing:=true; 
        if c=#$20 then hardspacing:=true; 
@@ -170,7 +174,8 @@
    c:=exc_str[i]; 
    if spacing then 
    begin // searching for beginning of keyword 
-     if pos(c,KEYWORDS_FIRST)>0 then // found our first keyword character 
+//     if pos(c,KEYWORDS_FIRST)>0 then // found our first keyword character
+     if pos(c,KEYWORDS_SEPARATORS)=0 then // found our first keyword character
      begin 
        start:=i; 
        spacing:=false; 
@@ -179,6 +184,7 @@
    else 
    begin // searching for end of keyword 
      if pos(c,KEYWORDS_SEPARATORS)>0 then // found spacing 
+     if not (ByteType(exc_str,i)=mbTrailByte) then
      begin 
        spacing:=true; 
        count:=i-start; 
@@ -205,6 +211,7 @@
 // returns index of keyword or -1 if keyword is invalid
 begin
  if Length(keyword)<1 then Result:=KEYWORDS_NOINDEX
+ else if pos(keyword[1],KEYWORDS_FIRST)=0 then result:=KEYWORDS_FIRST_COUNT-1//2byte char
  else result:=pos(keyword[1],KEYWORDS_FIRST)-1;
 end;