Skip to content

Commit

Permalink
first attempt to fix tables on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Dec 4, 2024
1 parent 37dcec1 commit d95a1ac
Show file tree
Hide file tree
Showing 3 changed files with 216 additions and 40 deletions.
11 changes: 11 additions & 0 deletions grobid-core/src/main/java/org/grobid/core/data/Table.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
public class Table extends Figure {
private List<LayoutToken> contentTokens = new ArrayList<>();
private List<LayoutToken> fullDescriptionTokens = new ArrayList<>();

// Contains the raw layoutTokens from the fulltext model
private List<LayoutToken> rawLayoutTokens = new ArrayList<>();
private boolean goodTable = true;

private StringBuilder note = null;
Expand Down Expand Up @@ -423,4 +426,12 @@ public boolean isGoodTable() {
public String getTeiId() {
return "tab_" + this.id;
}

public List<LayoutToken> getRawLayoutTokens() {
return rawLayoutTokens;
}

public void setRawLayoutTokens(List<LayoutToken> rawLayoutTokens) {
this.rawLayoutTokens = rawLayoutTokens;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@ public static List<GraphicObject> getConnectedGraphics(Block block, Document doc
public void postProcessTables() {
for (Table table : tables) {
if (!table.firstCheck()) {
table.setGoodTable(false);
continue;
}

Expand Down Expand Up @@ -919,7 +920,7 @@ public void postProcessTables() {
table.getContentTokens().clear();
table.getContentTokens().addAll(contentResult);

table.secondCheck();
table.setGoodTable(table.secondCheck());
}
}

Expand Down
Loading

0 comments on commit d95a1ac

Please sign in to comment.