apache lucene Hindi Stemmer - Java Search

Java examples for Search:Lucene

Description

apache lucene Hindi Stemmer

Demo Code


import org.apache.lucene.analysis.hi.HindiStemmer;

public class HindiUtil {
    public static void main(String[] args) throws Exception {
        System.out.println(getStemmedHindiWord("your word"));

    }//from   w ww . ja  va  2s . c  o m

    public static String getStemmedHindiWord(String givenWord) {
        char[] arr = givenWord.toCharArray();
        int newlength = new HindiStemmer().stem(arr, givenWord.length());
        return new String(arr).substring(0, newlength);
    }

}

Related Tutorials