i have tried to implemented class IndonesianAnalyzer from library org.apache.lucene.analysis.id.*; now i have a problem how to use initialize class indonesian analyzer to my project ,, my code like this ???
import java.io.*;
import org.apache.lucene.analysis.*;
import org.apache.lucene.analysis.snowball.*;
import org.apache.lucene.analysis.id.*;
public class exampleText {
public static String Stem(String text, String language){
StringBuffer result = new StringBuffer();
if (text!=null && text.trim().length()>0){
StringReader tReader = new StringReader(text);
IndonesianAnalyzer analyzer = new IndonesianAnalyzer(matchVersion);
TokenStream tStream = analyzer.tokenStream("contents", tReader);
TermAttribute term = tStream.addAttribute(TermAttribute.class);
try {
while (tStream.incrementToken()){
result.append(term.term());
result.append(" ");
}
} catch (IOException ioe){
System.out.println("Error: "+ioe.getMessage());
}
}
if (result.length()==0)
result.append(text);
return result.toString().trim();
}