That is awesome, just one thing, and forgive me if i sound ignorant.  What is
"FastZemberek zemberek"?

Ahmet Arslan wrote:
> 
> 
>> public class CustomFilter extends TokenFilter
>> {
>>     protected CustomFilter(TokenStream
>> tokenStream)
>>     {
>>         super(tokenStream);
>>     }
>>     @Override
>>     public Token next(final Token reusableToken)
>> throws IOException
>>     {
>>         Token nextToken =
>> input.next(reusableToken);
>>         
>>         if(nextToken != null)
>>         {
>>            
>> nextToken.setTermText(nextToken.termText().replaceAll(":|,|\\(|\\)|“|~|;|&|\\.",""));
>>         }
>>         return nextToken;
>>     }
>> }
> 
> Here is the the one that uses new token stream api: 
> 
> public final class CustomFilter extends TokenFilter {
> 
>    private final TermAttribute termAtt;
> 
>     public CustomFilter(TokenStream in, FastZemberek zemberek) {
>         super(in);
>         termAtt = (TermAttribute) addAttribute(TermAttribute.class);
>     }
>     
>     public final boolean incrementToken() throws IOException {
>         if (input.incrementToken()) {
>             String term = termAtt.term();
>             String s = term.replaceAll(":|,|\\(|\\)|“|~|;|&|\\.","");
>             if (s != null && !s.equals(term))
>                 termAtt.setTermBuffer(s);
>             return true;
>         } else {
>             return false;
>         }
>     }
> }
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
> For additional commands, e-mail: java-user-h...@lucene.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Lucene-Analyzer-that-can-handle-C%2B%2B-vs-C--tp26748041p26918236.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to