Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Apr 22, 2021
1 parent de7abbe commit 9338e2e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions grobid-core/src/main/java/org/grobid/core/data/BiblioItem.java
Expand Up @@ -53,7 +53,7 @@ public class BiblioItem {
* This is an internal structure not meant to be used outside. This is also modified with respect of other structures
* For collecting layout tokens of the various bibliographical component, please refers to @See(getLayoutTokens(TaggingLabels label)
*/
private List<LayoutToken> authorsLayoutTokensworkingCopy = new ArrayList<>();
private List<LayoutToken> authorsTokensWorkingCopy = new ArrayList<>();


@Override
Expand Down Expand Up @@ -1176,13 +1176,13 @@ public void setAuthors(String aut) {
authors = aut;
}

public BiblioItem addAuthorsToken(LayoutToken lt) {
authorsLayoutTokensworkingCopy.add(lt);
public BiblioItem collectAuthorsToken(LayoutToken lt) {
authorsTokensWorkingCopy.add(lt);
return this;
}

public void addAuthorsTokens(List<LayoutToken> layoutTokens) {
this.authorsLayoutTokensworkingCopy.addAll(layoutTokens);
public void collectAuthorsTokens(List<LayoutToken> layoutTokens) {
this.authorsTokensWorkingCopy.addAll(layoutTokens);
}

public void addAuthor(String aut) {
Expand Down Expand Up @@ -4629,7 +4629,7 @@ public void generalResultMapping(String labeledResult, List<LayoutToken> tokeniz
}
}

public List<LayoutToken> getAuthorsWorkingCopyTokens() {
return authorsLayoutTokensworkingCopy;
public List<LayoutToken> getAuthorsTokensWorkingCopy() {
return authorsTokensWorkingCopy;
}
}
Expand Up @@ -170,7 +170,7 @@ public String processingHeaderSection(GrobidAnalysisConfig config, Document doc,
boolean hasMarker = false;
List<Integer> authorsBlocks = new ArrayList<>();
List<List<LayoutToken>> authorSegments = new ArrayList<>();
List<LayoutToken> authorLayoutTokens = resHeader.getAuthorsWorkingCopyTokens();
List<LayoutToken> authorLayoutTokens = resHeader.getAuthorsTokensWorkingCopy();
if (isNotEmpty(authorLayoutTokens)) {
// split the list of layout tokens when token "\t" is met
List<LayoutToken> currentSegment = new ArrayList<>();
Expand Down Expand Up @@ -794,15 +794,15 @@ public BiblioItem resultExtraction(String result, List<LayoutToken> tokenization
if (biblio.getAuthors() != null) {
biblio.setAuthors(biblio.getAuthors() + "\t" + clusterNonDehypenizedContent);
//biblio.addAuthorsToken(new LayoutToken("\n", TaggingLabels.HEADER_AUTHOR));
biblio.addAuthorsToken(new LayoutToken("\t", TaggingLabels.HEADER_AUTHOR));
biblio.collectAuthorsToken(new LayoutToken("\t", TaggingLabels.HEADER_AUTHOR));

List<LayoutToken> tokens = cluster.concatTokens();
biblio.addAuthorsTokens(tokens);
biblio.collectAuthorsTokens(tokens);
} else {
biblio.setAuthors(clusterNonDehypenizedContent);

List<LayoutToken> tokens = cluster.concatTokens();
biblio.addAuthorsTokens(tokens);
biblio.collectAuthorsTokens(tokens);
}
} /*else if (clusterLabel.equals(TaggingLabels.HEADER_TECH)) {
biblio.setItem(BiblioItem.TechReport);
Expand Down

0 comments on commit 9338e2e

Please sign in to comment.