Skip to content

Commit

Permalink
update grobid to 0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed May 23, 2022
1 parent 2955ccc commit fc76c7b
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 5 deletions.
9 changes: 8 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,14 @@ dependencies {
testImplementation 'org.powermock:powermock-api-easymock:2.0.9'

//GROBID
implementation 'com.github.kermitt2:grobid:0.7.1'
implementation 'org.grobid:grobid-core:0.7.1'
implementation 'org.grobid:grobid-trainer:0.7.1'
implementation 'org.grobid:grobid-service:0.7.1'
implementation "xerces:xercesImpl:2.12.0"
implementation "net.arnx:jsonic:1.3.10"
implementation "net.sf.saxon:Saxon-HE:9.6.0-9"
implementation "xom:xom:1.3.2"
implementation 'javax.xml.bind:jaxb-api:2.3.0'

//Apache commons
implementation 'org.apache.commons:commons-collections4:4.4'
Expand Down
Binary file added localLibs/grobid-core-0.7.1.jar
Binary file not shown.
Binary file added localLibs/grobid-service-0.7.1.jar
Binary file not shown.
Binary file added localLibs/grobid-trainer-0.7.1.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private void setHeads(Sentence processedSentence,
return;

int startSentencePosition = processedSentence.getOffsetStart();
FeatureFactory featureFactory = FeatureFactory.getInstance();

List<SentenceParse> parses = processedSentence.getParses();
// we're just considering the first best parse
Expand Down Expand Up @@ -250,7 +251,7 @@ private void setHeads(Sentence processedSentence,
(funct.equals("pobj") && pos.startsWith("NN")) ||
(previousFunct.equals("num") && pos.startsWith("NN"))
) {
if (FeatureFactory.test_digit(pieces[1]))
if (featureFactory.test_digit(pieces[1]))
substance = new QuantifiedObject(pieces[1], pieces[1]);
else
substance = new QuantifiedObject(pieces[1], pieces[2]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void testPrintVector1() throws Exception {
expect(featureFactoryMock.test_all_capital(word)).andReturn(false);
expect(featureFactoryMock.test_first_capital(word)).andReturn(true);
expect(featureFactoryMock.test_number(word)).andReturn(false);
expect(FeatureFactory.test_digit(word)).andReturn(false);
expect(featureFactoryMock.test_digit(word)).andReturn(false);
replay(FeatureFactory.class, featureFactoryMock);

FeaturesVectorQuantities target = FeaturesVectorQuantities.addFeaturesQuantities(word, label, true, true, false);
Expand All @@ -55,7 +55,7 @@ public void testPrintVector2() throws Exception {
expect(featureFactoryMock.test_all_capital(word)).andReturn(false);
expect(featureFactoryMock.test_first_capital(word)).andReturn(true);
expect(featureFactoryMock.test_number(word)).andReturn(false);
expect(FeatureFactory.test_digit(word)).andReturn(false);
expect(featureFactoryMock.test_digit(word)).andReturn(false);
replay(FeatureFactory.class, featureFactoryMock);

FeaturesVectorQuantities target = FeaturesVectorQuantities.addFeaturesQuantities(word, label, true, true, false);
Expand All @@ -74,7 +74,7 @@ public void testPrintVector3() throws Exception {
expect(featureFactoryMock.test_all_capital(word)).andReturn(false);
expect(featureFactoryMock.test_first_capital(word)).andReturn(false);
expect(featureFactoryMock.test_number(word)).andReturn(false);
expect(FeatureFactory.test_digit(word)).andReturn(false);
expect(featureFactoryMock.test_digit(word)).andReturn(false);
replay(FeatureFactory.class, featureFactoryMock);

FeaturesVectorQuantities target = FeaturesVectorQuantities.addFeaturesQuantities(word, label, true, true, false);
Expand Down

0 comments on commit fc76c7b

Please sign in to comment.