Example usage for org.apache.lucene.analysis.ja.tokenattributes PartOfSpeechAttribute getPartOfSpeech

List of usage examples for org.apache.lucene.analysis.ja.tokenattributes PartOfSpeechAttribute getPartOfSpeech

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.ja.tokenattributes PartOfSpeechAttribute getPartOfSpeech.

Prototype

public String getPartOfSpeech();

Source Link

Usage

From source file:com.github.riccardove.easyjasub.lucene.LuceneParser.java

License:Apache License

private void readPartOfSpeech(TokenStream tokenStream, LuceneToken token) {
    PartOfSpeechAttribute partOfSpeech = tokenStream.getAttribute(PartOfSpeechAttribute.class);
    if (partOfSpeech != null) {
        String str = partOfSpeech.getPartOfSpeech();
        if (str != null) {
            token.setPartOfSpeech(LuceneUtil.translatePartOfSpeech(str));
        }/*from w w  w  .ja v a 2  s  .c o  m*/
    }
}