AnnotatedTree.Layer.NERLayer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AnnotatedTree Show documentation
Show all versions of AnnotatedTree Show documentation
Annotated constituency treebank library
package AnnotatedTree.Layer;
import NamedEntityRecognition.NamedEntityType;
public class NERLayer extends SingleWordLayer{
private NamedEntityType namedEntity = null;
/**
* Constructor for the named entity layer. Sets single named entity information for multiple words in
* the node.
* @param layerValue Layer value for the named entity information. Consists of single named entity information
* of multiple words.
*/
public NERLayer(String layerValue) {
layerName = "namedEntity";
setLayerValue(layerValue);
}
/**
* Sets the layer value for Named Entity layer. Converts the string form to a named entity.
* @param layerValue New value for Named Entity layer.
*/
public void setLayerValue(String layerValue){
this.layerValue = layerValue;
namedEntity = NamedEntityType.getNamedEntityType(layerValue);
}
/**
* Get the string form of the named entity value. Converts named entity type to string form.
* @return String form of the named entity value.
*/
public String getLayerValue(){
return NamedEntityType.getNamedEntityType(namedEntity);
}
}