dnaber      2004/08/10 12:02:47

  Modified:    src/java/org/apache/lucene/analysis/de GermanStemmer.java
  Log:
  Bernhard's fix for 'ß' not being replaced at the end of a word + plus a small code 
simplification by me
  
  PR: 29931
  Submitted by: Bernhard Messer
  
  Revision  Changes    Path
  1.12      +8 -6      
jakarta-lucene/src/java/org/apache/lucene/analysis/de/GermanStemmer.java
  
  Index: GermanStemmer.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-lucene/src/java/org/apache/lucene/analysis/de/GermanStemmer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- GermanStemmer.java        30 May 2004 20:24:20 -0000      1.11
  +++ GermanStemmer.java        10 Aug 2004 19:02:47 -0000      1.12
  @@ -178,15 +178,16 @@
           else if ( buffer.charAt( c ) == 'ü' ) {
             buffer.setCharAt( c, 'u' );
           }
  -        // Take care that at least one character is left left side from the current 
one
  -        if ( c < buffer.length() - 1 ) {
  -          if ( buffer.charAt( c ) == 'ß' ) {
  +        // Fix bug so that 'ß' at the end of a word is replaced.
  +        else if ( buffer.charAt( c ) == 'ß' ) {
               buffer.setCharAt( c, 's' );
               buffer.insert( c + 1, 's' );
               substCount++;
  -          }
  +        }
  +        // Take care that at least one character is left left side from the current 
one
  +        if ( c < buffer.length() - 1 ) {
             // Masking several common character combinations with an token
  -          else if ( ( c < buffer.length() - 2 ) && buffer.charAt( c ) == 's' &&
  +          if ( ( c < buffer.length() - 2 ) && buffer.charAt( c ) == 's' &&
               buffer.charAt( c + 1 ) == 'c' && buffer.charAt( c + 2 ) == 'h' )
             {
               buffer.setCharAt( c, '$' );
  @@ -260,4 +261,5 @@
           }
         }
       }
  +    
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to