diff --git a/grobid-core/src/main/java/org/grobid/core/data/Affiliation.java b/grobid-core/src/main/java/org/grobid/core/data/Affiliation.java
index fd8fe7bd17..282a4aa453 100755
--- a/grobid-core/src/main/java/org/grobid/core/data/Affiliation.java
+++ b/grobid-core/src/main/java/org/grobid/core/data/Affiliation.java
@@ -485,95 +485,6 @@ public int nbStructures() {
return nbStruct;
}
- /*@Deprecated
- public String toTEI() {
- StringBuilder tei = new StringBuilder();
- if (!isNotNull()) {
- return null;
- } else {
- tei.append("");
-
- if (departments != null) {
- if (departments.size() == 1) {
- tei.append("").append(TextUtilities.HTMLEncode(departments.get(0))).append("");
- } else {
- int q = 1;
- for (String depa : departments) {
- tei.append("").append(TextUtilities.HTMLEncode(depa)).append("");
- q++;
- }
- }
- }
-
- if (laboratories != null) {
- if (laboratories.size() == 1) {
- tei.append("").append(TextUtilities.HTMLEncode(laboratories.get(0))).append("");
- } else {
- int q = 1;
- for (String labo : laboratories) {
- tei.append("").append(TextUtilities.HTMLEncode(labo)).append("");
- q++;
- }
- }
- }
-
- if (institutions != null) {
- if (institutions.size() == 1) {
- tei.append("").append(TextUtilities.HTMLEncode(institutions.get(0))).append("");
- } else {
- int q = 1;
- for (String inst : institutions) {
- tei.append("").append(TextUtilities.HTMLEncode(inst)).append("");
- q++;
- }
- }
- }
-
- if ((getAddressString() != null) |
- (getAddrLine() != null) |
- (getPostBox() != null) |
- (getPostCode() != null) |
- (getSettlement() != null) |
- (getRegion() != null) |
- (getCountry() != null)) {
- tei.append("");
- if (getAddressString() != null) {
- tei.append("").append(TextUtilities.HTMLEncode(getAddressString())).append("");
- }
- if (getAddrLine() != null) {
- tei.append("").append(TextUtilities.HTMLEncode(getAddrLine())).append("");
- }
- if (getPostBox() != null) {
- tei.append("").append(TextUtilities.HTMLEncode(getPostBox())).append("");
- }
- if (getPostCode() != null) {
- tei.append("").append(TextUtilities.HTMLEncode(getPostCode())).append("");
- }
- if (getSettlement() != null) {
- tei.append("").append(TextUtilities.HTMLEncode(getSettlement())).append("");
- }
- if (getRegion() != null) {
- tei.append("").append(TextUtilities.HTMLEncode(getRegion())).append("");
- }
- if (getCountry() != null) {
- Lexicon lexicon = Lexicon.getInstance();
- String code = lexicon.getCountryCode(getCountry());
- tei.append("").append(TextUtilities.HTMLEncode(getCountry())).append("");
- }
- tei.append("");
- }
- tei.append("");
- }
-
- return tei.toString();
- }*/
-
public static String toTEI(Affiliation aff, int nbTag) {
return toTEI(aff, nbTag, null);
}
@@ -648,21 +559,22 @@ public static String toTEI(Affiliation aff, int nbTag, GrobidAnalysisConfig conf
}
}
- if ((aff.getAddressString() != null) ||
- (aff.getAddrLine() != null) ||
- (aff.getPostBox() != null) ||
- (aff.getPostCode() != null) ||
- (aff.getSettlement() != null) ||
- (aff.getRegion() != null) ||
- (aff.getCountry() != null)) {
+ if (
+ aff.getAddrLine() != null ||
+ aff.getPostBox() != null ||
+ aff.getPostCode() != null ||
+ aff.getSettlement() != null ||
+ aff.getRegion() != null ||
+ aff.getCountry() != null
+ ) {
TextUtilities.appendN(tei, '\t', nbTag + 2);
tei.append("
\n");
- if (aff.getAddressString() != null) {
+ /*if (aff.getAddressString() != null) {
TextUtilities.appendN(tei, '\t', nbTag + 3);
tei.append("" + TextUtilities.HTMLEncode(aff.getAddressString()) +
"\n");
- }
+ }*/
if (aff.getAddrLine() != null) {
TextUtilities.appendN(tei, '\t', nbTag + 3);
tei.append("" + TextUtilities.HTMLEncode(aff.getAddrLine()) +
diff --git a/grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java b/grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java
index 6d96d1a2b8..8d1204d62d 100755
--- a/grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java
+++ b/grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java
@@ -3869,21 +3869,22 @@ private void appendAffiliation(
}
}
- if ((aff.getAddressString() != null) ||
- (aff.getAddrLine() != null) ||
- (aff.getPostBox() != null) ||
- (aff.getPostCode() != null) ||
- (aff.getSettlement() != null) ||
- (aff.getRegion() != null) ||
- (aff.getCountry() != null)) {
+ if (
+ aff.getAddrLine() != null ||
+ aff.getPostBox() != null ||
+ aff.getPostCode() != null ||
+ aff.getSettlement() != null ||
+ aff.getRegion() != null ||
+ aff.getCountry() != null
+ ) {
TextUtilities.appendN(tei, '\t', nbTag + 1);
tei.append("\n");
- if (aff.getAddressString() != null) {
+ /*if (aff.getAddressString() != null) {
TextUtilities.appendN(tei, '\t', nbTag + 2);
tei.append("" + TextUtilities.HTMLEncode(aff.getAddressString()) +
"\n");
- }
+ }*/
if (aff.getAddrLine() != null) {
TextUtilities.appendN(tei, '\t', nbTag + 2);
tei.append("" + TextUtilities.HTMLEncode(aff.getAddrLine()) +
diff --git a/grobid-core/src/main/java/org/grobid/core/engines/AffiliationAddressParser.java b/grobid-core/src/main/java/org/grobid/core/engines/AffiliationAddressParser.java
index 01c974e52a..95798c36c9 100755
--- a/grobid-core/src/main/java/org/grobid/core/engines/AffiliationAddressParser.java
+++ b/grobid-core/src/main/java/org/grobid/core/engines/AffiliationAddressParser.java
@@ -261,10 +261,10 @@ protected List resultExtractionLayoutTokens(String result, List res = engine.processAffiliation(affiliationSequence1);
+ List res = engine.processAffiliation(affiliationSequence1);
assertEquals(1, res.size());
if (res.size() > 0) {
assertNotNull(res.get(0).getInstitutions());