Skip to content

Commit 4b77e73

Browse files
authored
Merge pull request #1070 from kermitt2/bugfix/fix-coord-name-title
correct <title> coordinates attribute name
2 parents 6bd974d + 6eaa6f4 commit 4b77e73

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,7 @@ public String toTEI(int n, int indent, GrobidAnalysisConfig config) {
22632263
if (titleTokens != null && titleTokens.size()>0) {
22642264
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
22652265
if (coords != null && coords.length()>0) {
2266-
tei.append(" coord=\"" + coords + "\"");
2266+
tei.append(" coords=\"" + coords + "\"");
22672267
}
22682268
}
22692269
}
@@ -2276,7 +2276,7 @@ public String toTEI(int n, int indent, GrobidAnalysisConfig config) {
22762276
if (titleTokens != null && titleTokens.size()>0) {
22772277
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
22782278
if (coords != null && coords.length()>0) {
2279-
tei.append(" coord=\"" + coords + "\"");
2279+
tei.append(" coords=\"" + coords + "\"");
22802280
}
22812281
}
22822282
}
@@ -2426,7 +2426,7 @@ else if (bookTitle == null) {
24262426
if (titleTokens != null && titleTokens.size()>0) {
24272427
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
24282428
if (coords != null && coords.length()>0) {
2429-
tei.append(" coord=\"" + coords + "\"");
2429+
tei.append(" coords=\"" + coords + "\"");
24302430
}
24312431
}
24322432
}
@@ -2450,7 +2450,7 @@ else if (bookTitle == null) {
24502450
if (titleTokens != null && titleTokens.size()>0) {
24512451
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
24522452
if (coords != null && coords.length()>0) {
2453-
tei.append(" coord=\"" + coords + "\"");
2453+
tei.append(" coords=\"" + coords + "\"");
24542454
}
24552455
}
24562456
}
@@ -2682,7 +2682,7 @@ else if (this.getYear().length() == 4)
26822682
if (titleTokens != null && titleTokens.size()>0) {
26832683
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
26842684
if (coords != null && coords.length()>0) {
2685-
tei.append(" coord=\"" + coords + "\"");
2685+
tei.append(" coords=\"" + coords + "\"");
26862686
}
26872687
}
26882688
}
@@ -2709,7 +2709,7 @@ else if (this.getYear().length() == 4)
27092709
if (titleTokens != null && titleTokens.size()>0) {
27102710
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
27112711
if (coords != null && coords.length()>0) {
2712-
tei.append(" coord=\"" + coords + "\"");
2712+
tei.append(" coords=\"" + coords + "\"");
27132713
}
27142714
}
27152715
}
@@ -3791,7 +3791,7 @@ private void appendAffiliation(
37913791
List<LayoutToken> affTokens = aff.getLayoutTokens();
37923792
String coords = LayoutTokensUtil.getCoordsString(affTokens);
37933793
if (coords != null && coords.length()>0) {
3794-
tei.append(" coord=\"" + coords + "\"");
3794+
tei.append(" coords=\"" + coords + "\"");
37953795
}
37963796
}
37973797
tei.append(">\n");

grobid-core/src/main/java/org/grobid/core/document/TEIFormatter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public StringBuilder toTEIHeader(BiblioItem biblio,
154154
if (titleTokens != null && titleTokens.size()>0) {
155155
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
156156
if (coords != null) {
157-
tei.append(" coord=\"" + coords + "\"");
157+
tei.append(" coords=\"" + coords + "\"");
158158
}
159159
}
160160
}
@@ -394,7 +394,7 @@ else if (biblio.getE_Year().length() == 4)
394394
if (titleTokens != null && titleTokens.size()>0) {
395395
String coords = LayoutTokensUtil.getCoordsString(titleTokens);
396396
if (coords != null) {
397-
tei.append(" coord=\"" + coords + "\"");
397+
tei.append(" coords=\"" + coords + "\"");
398398
}
399399
}
400400
}

grobid-core/src/main/java/org/grobid/core/engines/ProcessEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void processFullText(final GrobidMainArgs pGbdArgs) throws Exception {
137137
} else {
138138
List<String> elementCoordinates = null;
139139
if (pGbdArgs.getTeiCoordinates()) {
140-
elementCoordinates = Arrays.asList("figure", "persName", "ref", "biblStruct", "formula", "s", "note");
140+
elementCoordinates = Arrays.asList("figure", "persName", "ref", "biblStruct", "formula", "s", "note", "title", "head");
141141
}
142142
processFullTextDirectory(files, pGbdArgs, pGbdArgs.getPath2Output(), pGbdArgs.getSaveAssets(),
143143
elementCoordinates, pGbdArgs.getSegmentSentences(), pGbdArgs.getAddElementId());

grobid-service/src/main/resources/web/grobid/grobid.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var grobid = (function($) {
1313

1414
var block = 0;
1515

16-
var elementCoords = ['s', 'biblStruct', 'persName', 'figure', 'formula', 'head', 'note'];
16+
var elementCoords = ['s', 'biblStruct', 'persName', 'figure', 'formula', 'head', 'note', 'title'];
1717

1818
function defineBaseURL(ext) {
1919
var baseUrl = null;

0 commit comments

Comments
 (0)