mirror of https://github.com/apache/lucene.git
LUCENE-8570: Fix possible NPE in the attribute reflection of the Nori's PartOfSpeechAttributeImpl
This commit is contained in:
parent
2459072286
commit
2da72ad05c
|
@ -62,11 +62,12 @@ public class PartOfSpeechAttributeImpl extends AttributeImpl implements PartOfSp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reflectWith(AttributeReflector reflector) {
|
public void reflectWith(AttributeReflector reflector) {
|
||||||
reflector.reflect(PartOfSpeechAttribute.class, "posType", getPOSType().name());
|
String posName = getPOSType() == null ? null : getPOSType().name();
|
||||||
Tag leftPOS = getLeftPOS();
|
String rightPOS = getRightPOS() == null ? null : getRightPOS().name() + "(" + getRightPOS().description() + ")";
|
||||||
reflector.reflect(PartOfSpeechAttribute.class, "leftPOS", leftPOS.name() + "(" + leftPOS.description() + ")");
|
String leftPOS = getLeftPOS() == null ? null : getLeftPOS().name() + "(" + getLeftPOS().description() + ")";
|
||||||
Tag rightPOS = getRightPOS();
|
reflector.reflect(PartOfSpeechAttribute.class, "posType", posName);
|
||||||
reflector.reflect(PartOfSpeechAttribute.class, "rightPOS", rightPOS.name() + "(" + rightPOS.description() + ")");
|
reflector.reflect(PartOfSpeechAttribute.class, "leftPOS", leftPOS);
|
||||||
|
reflector.reflect(PartOfSpeechAttribute.class, "rightPOS", rightPOS);
|
||||||
reflector.reflect(PartOfSpeechAttribute.class, "morphemes", displayMorphemes(getMorphemes()));
|
reflector.reflect(PartOfSpeechAttribute.class, "morphemes", displayMorphemes(getMorphemes()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue