1 package org.apache.lucene.analysis.el; 2 3 18 19 import org.apache.lucene.analysis.TokenFilter; 20 import org.apache.lucene.analysis.Token; 21 import org.apache.lucene.analysis.TokenStream; 22 23 28 public final class GreekLowerCaseFilter extends TokenFilter 29 { 30 char[] charset; 31 32 public GreekLowerCaseFilter(TokenStream in, char[] charset) 33 { 34 super(in); 35 this.charset = charset; 36 } 37 38 public final Token next() throws java.io.IOException 39 { 40 Token t = input.next(); 41 42 if (t == null) 43 return null; 44 45 String txt = t.termText(); 46 47 char[] chArray = txt.toCharArray(); 48 for (int i = 0; i < chArray.length; i++) 49 { 50 chArray[i] = GreekCharsets.toLowerCase(chArray[i], charset); 51 } 52 53 String newTxt = new String (chArray); 54 Token newToken = new Token(newTxt, t.startOffset(), t.endOffset()); 56 57 return newToken; 58 } 59 } 60 | Popular Tags |