2003.02.04 (火) 17:24:37 <u*j*2*6*> 全角のカッコ記号も区切り文字にしました。あと、2バイト文字と1バイト文字の間でも区切るようにしました。
2003.02.04 (火) 17:25:01 <u*j*2*6*> 日本語検索がだいぶやりやすくなったとおもいます
2003.02.05 (水) 17:26:57 <u*j*2*6*> 2バイト文字のブロックキーワード登録がうまくいかないバグがありました。ちかいうちになおします
shuusei24116:2バイト文字のキーワード対応を強化(24109参照)

diff --dos -wurN 24115/constants.pas 24116/constants.pas
--- 24115/constants.pas	Tue Jan 28 23:03:00 2003
+++ 24116/constants.pas	Tue Feb 04 16:27:20 2003
@@ -96,6 +96,8 @@
                                 #$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.
                                                                  // this list and KEYWORDS_FIRST list CANNOT contain any same character
+ KEYWORDS_SEPARATORS_2BYTE    = '≪≫〈〉{}「」()[]『』《》〔〕【】'
+                               +'*+、,−。./・:;<=>?!_¥‘’”#$%&〜^'; // list of 2byte whitespaces
  KEYWORDS_SEPARATORS_COUNT    = 54; // number of items in KEYWORDS_SEPARATORS
  KEYWORDS_NOINDEX             = -1; // unknown index in keywords list
  MIN_FILE_NAME                = 5; // minimum filename allowed to share (including directory and extension) - constant used internally. don't make it less than '5'
diff --dos -wurN 24115/keywords.pas 24116/keywords.pas
--- 24115/keywords.pas	Tue Jan 28 16:05:02 2003
+++ 24116/keywords.pas	Tue Feb 04 17:12:30 2003
@@ -52,7 +52,9 @@
  i, start, count, added, crc: Integer;
  spacing: Boolean;
  c: Char;
+ s: String;
  item: String;
+ t,tprev,tnext: TMbcsByteType;
 begin // extract up to $limit keywords from string and add it to list with CRC
  // before calling this function you should add ' ' at the end of string or you might loose your last keyword
  tmp_pos:=1280;
@@ -61,10 +63,31 @@
  for i:=1 to Length(str) do
  begin
    c:=str[i];
+   t:=ByteType(str,i);
+   case t of
+     mbSingleByte:
+     begin
+       s:=str[i];
+       tprev:=ByteType(str,i-1);
+       tnext:=ByteType(str,i+1);
+     end;
+     mbLeadByte  :
+     begin
+       s:=str[i]+str[i+1];
+       tprev:=ByteType(str,i-1);
+       tnext:=ByteType(str,i+2);
+     end;
+     mbTrailByte : continue;
+   else continue;
+   end;
+
    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_SEPARATORS)=0 then // found our first keyword character
+     if ((t=mbSingleByte) and (tprev=mbTrailByte)) or
+        ((t=mbSingleByte) and (pos(s,KEYWORDS_SEPARATORS)=0)) or
+        ((t=mbLeadByte) and (tprev=mbSingleByte)) or
+        ((t=mbLeadByte) and (AnsiPos(s,KEYWORDS_SEPARATORS_2BYTE)=0)) then // found our first keyword character
      begin
        start:=i;
        spacing:=false;
@@ -72,8 +95,10 @@
    end
    else
    begin // searching for end of keyword
-     if pos(c,KEYWORDS_SEPARATORS)>0 then // found spacing
-     if not (ByteType(str,i)=mbTrailByte) then
+     if ((t=mbSingleByte) and (tnext=mbLeadByte)) or
+        ((t=mbSingleByte) and (pos(s,KEYWORDS_SEPARATORS)>0)) or
+        ((t=mbLeadByte) and (tnext=mbSingleByte)) or
+        ((t=mbLeadByte) and (AnsiPos(s,KEYWORDS_SEPARATORS_2BYTE)>0)) then // found spacing
      begin
        spacing:=true;
        count:=i-start;
@@ -100,7 +125,9 @@
  i, j, start, count, added, crc: Integer; 
  spacing, hardspacing, excluding, last_exc: Boolean; 
  c: Char; 
+ s: String;
  item: String; 
+ t,tprev,tnext: TMbcsByteType;
 begin // extract up to $limit keywords from string and add it to list with CRC 
  // before calling this function you should add ' ' at the end of string or you might loose your last keyword 
  tmp_pos:=1280; 
@@ -111,10 +138,31 @@
  for i:=1 to Length(inc_str) do 
  begin 
    c:=inc_str[i]; 
+   t:=ByteType(inc_str,i);
+   case t of
+     mbSingleByte:
+     begin
+       s:=inc_str[i];
+       tprev:=ByteType(inc_str,i-1);
+       tnext:=ByteType(inc_str,i+1);
+     end;
+     mbLeadByte  :
+     begin
+       s:=inc_str[i]+inc_str[i+1];
+       tprev:=ByteType(inc_str,i-1);
+       tnext:=ByteType(inc_str,i+2);
+     end;
+     mbTrailByte : continue;
+   else continue;
+   end;
+
    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_SEPARATORS)=0 then // found our first keyword character
+     if ((t=mbSingleByte) and (tprev=mbTrailByte)) or
+        ((t=mbSingleByte) and (pos(s,KEYWORDS_SEPARATORS)=0)) or
+        ((t=mbLeadByte) and (tprev=mbSingleByte)) or
+        ((t=mbLeadByte) and (AnsiPos(s,KEYWORDS_SEPARATORS_2BYTE)=0)) then // found our first keyword character
      begin
        start:=i;
        spacing:=false; 
@@ -124,11 +172,11 @@
      end 
      else 
      begin 
-      if (c='-') and hardspacing then
+      if (s='-') and hardspacing then
         last_exc:=true
       else
         last_exc:=false;
-      if c=#$20 then hardspacing:=true 
+      if s=#$20 then hardspacing:=true
       else hardspacing:=false;
      end;
    end 
@@ -136,11 +184,13 @@
    begin // searching for end of keyword
      last_exc:=false;
      hardspacing:=false; 
-     if pos(c,KEYWORDS_SEPARATORS)>0 then // found spacing 
-     if not (ByteType(inc_str,i)=mbTrailByte) then
+     if ((t=mbSingleByte) and (tnext=mbLeadByte)) or
+        ((t=mbSingleByte) and (pos(s,KEYWORDS_SEPARATORS)>0)) or
+        ((t=mbLeadByte) and (tnext=mbSingleByte)) or
+        ((t=mbLeadByte) and (AnsiPos(s,KEYWORDS_SEPARATORS_2BYTE)>0)) then // found spacing
      begin
        spacing:=true;
-       if c=#$20 then hardspacing:=true;
+       if s=#$20 then hardspacing:=true;
        count:=i-start;
        if count>=KEYWORD_LEN_MIN then
        begin 
@@ -172,10 +222,31 @@
  for i:=1 to Length(exc_str) do 
  begin 
    c:=exc_str[i]; 
+   t:=ByteType(exc_str,i);
+   case t of
+     mbSingleByte:
+     begin
+       s:=exc_str[i];
+       tprev:=ByteType(exc_str,i-1);
+       tnext:=ByteType(exc_str,i+1);
+     end;
+     mbLeadByte  :
+     begin
+       s:=exc_str[i]+exc_str[i+1];
+       tprev:=ByteType(exc_str,i-1);
+       tnext:=ByteType(exc_str,i+2);
+     end;
+     mbTrailByte : continue;
+   else continue;
+   end;
+
    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_SEPARATORS)=0 then // found our first keyword character
+     if ((t=mbSingleByte) and (tprev=mbTrailByte)) or
+        ((t=mbSingleByte) and (pos(s,KEYWORDS_SEPARATORS)=0)) or
+        ((t=mbLeadByte) and (tprev=mbSingleByte)) or
+        ((t=mbLeadByte) and (AnsiPos(s,KEYWORDS_SEPARATORS_2BYTE)=0)) then // found our first keyword character
      begin
        start:=i; 
        spacing:=false; 
@@ -183,8 +254,10 @@
    end 
    else 
    begin // searching for end of keyword 
-     if pos(c,KEYWORDS_SEPARATORS)>0 then // found spacing 
-     if not (ByteType(exc_str,i)=mbTrailByte) then
+     if ((t=mbSingleByte) and (tnext=mbLeadByte)) or
+        ((t=mbSingleByte) and (pos(s,KEYWORDS_SEPARATORS)>0)) or
+        ((t=mbLeadByte) and (tnext=mbSingleByte)) or
+        ((t=mbLeadByte) and (AnsiPos(s,KEYWORDS_SEPARATORS_2BYTE)>0)) then // found spacing
      begin
        spacing:=true; 
        count:=i-start;