Update jruby to 9.4.12.1 by lfoppiano · Pull Request #1293 · grobidOrg/grobid (original) (raw)

@lfoppiano

This PR fixes the regression introduced by updating to jruby 9.4.12.0 (in #1261):

More tests are required, ideally a few thousand PDFs. Before testing, you have to switch to the pragmatic segmenter in the configuration:

  sentenceDetectorFactory: "org.grobid.core.lang.impl.PragmaticSentenceDetectorFactory"
#  sentenceDetectorFactory: "org.grobid.core.lang.impl.OpenNLPSentenceDetectorFactory"

@lfoppiano

@coveralls

Coverage Status

coverage: 40.576%. remained the same
when pulling a0a82bb on bugfix/fix-jruby-update
into 23eef0f on master.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates JRuby to 9.4.12.1 and bumps the pragmatic segmenter version to 0.3.24 to address a regression introduced in the previous update. Key changes include updating version numbers, refactoring method calls from instance calls to the new Rule.apply class method across multiple files, and adjusting text initialization from Text.new(text) to text.dup.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file

File Description
grobid-home/sentence-segmentation/pragmatic_segmenter/version.rb Bumped version from "0.3.22" to "0.3.24".
grobid-home/sentence-segmentation/pragmatic_segmenter/types.rb Refactored rule application to use the new Rule.apply class method.
grobid-home/sentence-segmentation/pragmatic_segmenter/punctuation_replacer.rb Updated rule calls to use Rule.apply for both @text and local variables.
grobid-home/sentence-segmentation/pragmatic_segmenter/processor.rb Replaced instance .apply calls with Rule.apply for consistency.
grobid-home/sentence-segmentation/pragmatic_segmenter/list.rb Changed Text instantiation to text duplications and updated rule calls accordingly.
grobid-home/sentence-segmentation/pragmatic_segmenter/languages/* Standardized rule application for various language-specific processors.
grobid-home/sentence-segmentation/pragmatic_segmenter/cleaner.rb Updated text initialization and switched to Rule.apply throughout.
grobid-home/sentence-segmentation/pragmatic_segmenter/abbreviation_replacer.rb Applied similar changes to text handling and rule application.

Comments suppressed due to low confidence (2)

grobid-home/sentence-segmentation/pragmatic_segmenter/languages/common/numbers.rb:50

NUMBERED_REFERENCE_REGEX = /(?<=[^\d\s])(\.|∯)((\[(\d{1,3},?\s?-?\s?)?\b\d{1,3}\])+|((\d{1,3}\s?){0,3}\d{1,3}))(\s)(?=[A-Z])/

grobid-home/sentence-segmentation/pragmatic_segmenter/list.rb:51

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})