From 81a1691008a0c232bbbf878c0defb7a6c65ef346 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Tue, 17 Dec 2024 11:16:40 +0100 Subject: [PATCH] fix typo --- .../java/org/grobid/core/engines/FullTextParser.java | 4 ++-- .../org/grobid/core/engines/FullTextParserTest.kt | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/grobid-core/src/main/java/org/grobid/core/engines/FullTextParser.java b/grobid-core/src/main/java/org/grobid/core/engines/FullTextParser.java index 30815e5e44..494cecf872 100755 --- a/grobid-core/src/main/java/org/grobid/core/engines/FullTextParser.java +++ b/grobid-core/src/main/java/org/grobid/core/engines/FullTextParser.java @@ -371,7 +371,7 @@ static String revertResultsForBadItems(List badFiguresOrTables for (Figure badItem : badFiguresOrTables) { // Find the index of the first layoutToken of the table in the tokenization List layoutTokenItem = badItem.getLayoutTokens(); - List candidateIndexes = findCandiateIndex(layoutTokenItem, labelledResultsAsList, itemLabel); + List candidateIndexes = findCandidateIndex(layoutTokenItem, labelledResultsAsList, itemLabel); if (candidateIndexes.isEmpty()) { LOGGER.info("Cannot find the candidate index for fixing the tables."); continue; @@ -441,7 +441,7 @@ static int consolidateResultCandidateThroughSequence(List candidateInde } @NotNull - static List findCandiateIndex(List layoutTokenItem, List> labelledResultsAsList, String itemLabel) { + static List findCandidateIndex(List layoutTokenItem, List> labelledResultsAsList, String itemLabel) { LayoutToken firstLayoutTokenItem = layoutTokenItem.get(0); List candidateIndexes = IntStream.range(0, labelledResultsAsList.size()) diff --git a/grobid-core/src/test/kotlin/org/grobid/core/engines/FullTextParserTest.kt b/grobid-core/src/test/kotlin/org/grobid/core/engines/FullTextParserTest.kt index f76abe84fd..e816bb4b00 100644 --- a/grobid-core/src/test/kotlin/org/grobid/core/engines/FullTextParserTest.kt +++ b/grobid-core/src/test/kotlin/org/grobid/core/engines/FullTextParserTest.kt @@ -2,10 +2,7 @@ package org.grobid.core.engines import org.apache.commons.lang3.StringUtils import org.apache.commons.lang3.tuple.Triple -import org.easymock.EasyMock.createMock import org.grobid.core.analyzers.GrobidAnalyzer -import org.grobid.core.document.Document -import org.grobid.core.document.DocumentSource import org.grobid.core.engines.label.TaggingLabels.TABLE_LABEL import org.grobid.core.factory.GrobidFactory import org.grobid.core.main.LibraryLoader @@ -234,10 +231,7 @@ class FullTextParserTest { } @Test - fun testFindCandidates() { - var mockDocumentSource = createMock(DocumentSource::class.java) - var document = Document.createFromText("") - + fun testFindCandidates_shouldFindMultipleResults() { // i need to prepare a sequence where there might be multiple matches, // and then verify that the sequence is correctly used for discrimination var sequence = "This article solves the problem where some of our interaction are fauly. " + @@ -284,7 +278,7 @@ class FullTextParserTest { println(wapitiResult) val table1Tokens = tokens.subList(25, 61) - val foundCandidateIndex = FullTextParser.findCandiateIndex(table1Tokens, labelledResultsAsList, TABLE_LABEL) + val foundCandidateIndex = FullTextParser.findCandidateIndex(table1Tokens, labelledResultsAsList, TABLE_LABEL) assertThat(foundCandidateIndex, hasSize(3)) assertThat(foundCandidateIndex.get(0), `is`(13))