Skip to content

Commit

Permalink
Indicate acronym entity
Browse files Browse the repository at this point in the history
  • Loading branch information
kermitt2 committed Jul 15, 2017
1 parent 0ce838b commit 2cd2365
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions grobid-ner/src/main/java/org/grobid/core/data/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public String getName() {

// orign of the entity definition
private Origin origin = Origin.GROBID;

// if the entity is an acronym; if true, the normalisedName will give the found expended form
private boolean isAcronym = false;

public Entity() {
this.offsets = new OffsetPosition();
Expand All @@ -85,6 +88,7 @@ public Entity(Entity ent) {
sense = ent.sense;
origin = ent.origin;
boundingBoxes = ent.boundingBoxes;
isAcronym = ent.isAcronym;
//startTokenPos = ent.startTokenPos;
//endTokenPos = ent.startTokenPos;
}
Expand Down Expand Up @@ -223,6 +227,14 @@ public void addBoundingBoxes(BoundingBox boundingBox) {
this.boundingBoxes.add(boundingBox);
}

public boolean getIsAcronym() {
return this.isAcronym;
}

public void setIsAcronym(boolean acronym) {
this.isAcronym = acronym;
}

@Override
public boolean equals(Object object) {
boolean result = false;
Expand Down Expand Up @@ -378,7 +390,7 @@ public String toString() {
/**
* Export of entity annotation in TEI standoff format
*/
public String toTEI(String id, int n) {
/*public String toTEI(String id, int n) {
StringBuffer buffer = new StringBuffer();
buffer.append("<stf xml:id=\"" + "ner-" + n + "\" type=\"ne\" who=\"nerd\" when=\"\">");
buffer.append("<ptr target=\"id," + offsets.start + "," + offsets.end + "\" />");
Expand All @@ -387,5 +399,5 @@ public String toTEI(String id, int n) {
}
buffer.append("</stf>");
return buffer.toString();
}
}*/
}

0 comments on commit 2cd2365

Please sign in to comment.