Skip to content

Commit

Permalink
fix mess from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Jan 6, 2025
1 parent a45e2bf commit 164636b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static Flavor fromLabel(String text) {
public String toString() {
return getLabel();
}
}

public static List<String> getLabels() {
return Arrays.stream(Flavor.values())
.map(Flavor::getLabel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public FullTextParser(EngineParsers parsers) {
this(parsers, null);
}

public FullTextParser(EngineParsers parsers, Flavor flavor) {
public FullTextParser(EngineParsers parsers, GrobidModels.Flavor flavor) {
super(GrobidModels.getModelFlavor(FULLTEXT, flavor));
this.parsers = parsers;
tmpPath = GrobidProperties.getTempPath();
Expand Down Expand Up @@ -308,11 +308,11 @@ else if (config.getConsolidateCitations() == 2)
resultHeaderAsArray[0] = resultHeaderAsArray[0].replace(PARAGRAPH_LABEL, "I-" + PARAGRAPH_LABEL);
resultHeader = String.join("\n", resultHeaderAsArray);

resultBody = StringUtils.strip(resultHeader + "\n" + resultBody);
bodyResults = StringUtils.strip(resultHeader + "\n" + bodyResults);
List<LayoutToken> concatenatedTokenization = Stream
.concat(tokensHeader.stream(), layoutTokenization.getTokenization().stream())
.concat(tokensHeader.stream(), bodyLayoutTokens.getTokenization().stream())
.collect(Collectors.toList());
layoutTokenization.setTokenization(concatenatedTokenization);
bodyLayoutTokens.setTokenization(concatenatedTokenization);
}

// we apply now the figure and table models based on the fulltext labeled output
Expand Down Expand Up @@ -1267,7 +1267,7 @@ public Document createTraining(File inputFile,
String pathFullText,
String pathTEI,
int id,
Flavor flavor) {
GrobidModels.Flavor flavor) {
if (tmpPath == null)
throw new GrobidResourceException("Cannot process pdf file, because temp path is null.");
if (!tmpPath.exists()) {
Expand Down

0 comments on commit 164636b

Please sign in to comment.