Back to project page sdk-stemmer.
The source code is released under:
GNU Lesser General Public License
If you think the Android project sdk-stemmer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.silpa.stemmer; //www . j a v a 2 s .c o m import android.content.Context; import android.util.AttributeSet; import org.silpa.render.IndicTextView; import java.util.Map; /** * Created by sujith on 13/6/14. */ public class StemmerTextView extends IndicTextView implements StemmerInterface { /** * Context of application */ private Context mContext; /** * Stemmer object to stem words */ private Stemmer stemmer; /** * Constructor * * @param context context of application */ public StemmerTextView(Context context) { super(context); init(); } /** * Constructor * * @param context context of application * @param attrs attribute set */ public StemmerTextView(Context context, AttributeSet attrs) { super(context, attrs); init(); } /** * Constructor * * @param context context of application * @param attrs attribute set * @param defStyle default style */ public StemmerTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { this.mContext = getContext(); this.stemmer = new Stemmer(this.mContext); } /** * This function is used to get all stemmed words * in an array * * @return string array */ @Override public String[] getStemWordsAsArray() { return this.stemmer.getStemWordsAsArray(getText().toString()); } /** * This function is used to get all stemmed words * as a map * * @return map<String, String> */ @Override public Map<String, String> getStemWordsAsMap() { return this.stemmer.getStemWordsAsMap(getText().toString()); } /** * This function gives name of the module * * @return name of module */ @Override public String getModuleName() { return this.stemmer.getModuleName(); } /** * This function gives a brief description of the module * * @return brief information regarding the module */ @Override public String getModuleInformation() { return this.stemmer.getModuleInformation(); } }