private static String lightStem(String string) { ArabicNormalizer arabicNorm = new ArabicNormalizer(); char[] c = string.toCharArray(); int len = c.length; len = arabicNorm.normalize(c, len); char[] normalizedWord = new char[len]; System.arraycopy(c, 0, normalizedWord, 0, len); ArabicStemmer araLightStemmer = new ArabicStemmer(); len = araLightStemmer.stem(normalizedWord, len); char[] lightWord = new char[len]; System.arraycopy(normalizedWord, 0, lightWord, 0, len); StringBuilder sbuf = new StringBuilder(); sbuf.append(lightWord); String result = sbuf.toString(); return result; }
private LuceneStemmerAdapter() { delegate = new org.apache.lucene.analysis.ar.ArabicStemmer(); normalizer = new org.apache.lucene.analysis.ar.ArabicNormalizer(); }