-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adapt acknowledgmentParser with a new method using TokenClusteror, fi…
…x all class linked with it, fix the test class as well
- Loading branch information
1 parent
b1c8152
commit 21a4ef8
Showing
12 changed files
with
686 additions
and
888 deletions.
There are no files selected for viewing
33 changes: 0 additions & 33 deletions
33
grobid-core/src/main/java/org/grobid/core/data/Acknow.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
grobid-core/src/main/java/org/grobid/core/data/AcknowledgmentItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.grobid.core.data; | ||
|
||
import org.grobid.core.utilities.TextUtilities; | ||
|
||
/** | ||
* A class for saving and exchancing information regarding acknowledgment item consisting of the text, | ||
* the type label (affiliation, educational institution, individual, etc) | ||
* and the bounding box coordinates. | ||
* | ||
* Created by Tanti, 2019 | ||
*/ | ||
|
||
|
||
public class AcknowledgmentItem { | ||
String label; | ||
String text; | ||
String coords; | ||
|
||
public String getLabel() { | ||
return label; | ||
} | ||
|
||
public void setLabel(String label) { | ||
this.label = label; | ||
} | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
|
||
public String getCoords() { | ||
return coords; | ||
} | ||
|
||
public void setCoords(String coords) { | ||
this.coords = coords; | ||
} | ||
|
||
// result of acknowledgment string processing | ||
public String toTEI(){ | ||
StringBuilder tei = new StringBuilder(); | ||
if (label== null) { | ||
return null; | ||
} else { | ||
|
||
tei.append("<").append(label).append(">"). | ||
append(TextUtilities.HTMLEncode(text)). | ||
append("</").append(label).append(">"); | ||
} | ||
return tei.toString(); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.