Allow roman numerals, forward slash and sequentes in page checker#15497
Conversation
Review Summary by QodoSupport Roman numerals and BibLaTeX formats in page checker
WalkthroughsDescription• Add support for Roman numerals in page ranges (i, iv, X, etc.) • Add support for forward slash separator and Latin continuity suffixes (f., ff., sq., sqq.) • Refactor page validation regex patterns for BibTeX and BibLaTeX formats • Fix page prefix extraction to handle Roman numerals and mixed formats • Add comprehensive test cases for new page formats and invalid ranges Diagramflowchart LR
A["Page Checker Input"] --> B["Updated Regex Patterns"]
B --> C["Roman Numerals Support"]
B --> D["Forward Slash Separator"]
B --> E["Sequens/Sequentes Support"]
C --> F["BracketedPattern Methods"]
D --> F
E --> F
F --> G["firstPage/lastPage/pagePrefix"]
G --> H["Citation Key Generation"]
File Changes1. jablib/src/main/java/org/jabref/logic/integrity/PagesChecker.java
|
Code Review by Qodo
1.
|
|
The pipeline for guard-review is failling, idk why. Since i didnt change worflow files. Please notify me if i have to do something else to fix this. |
Review Summary by QodoSupport Roman numerals and BibLaTeX page formats
WalkthroughsDescription• Add support for Roman numerals in page ranges • Add support for forward slash separator and sequens/sequentes suffixes • Refactor page number parsing to handle mixed decimal and Roman formats • Add comprehensive test cases for valid and invalid page formats Diagramflowchart LR
A["Page Input<br/>1-10, iv-xx, 1/10"] --> B["PagesChecker<br/>Regex Patterns"]
B --> C["Roman Number<br/>Pattern"]
B --> D["Decimal Number<br/>Pattern"]
B --> E["Separators<br/>-, --, /, +"]
B --> F["Sequens/Sequentes<br/>f, ff, sq, sqq"]
C --> G["BracketedPattern<br/>Page Processing"]
D --> G
E --> G
F --> G
G --> H["firstPage<br/>lastPage<br/>pagePrefix"]
H --> I["Citation Key<br/>Generation"]
File Changes1. jablib/src/main/java/org/jabref/logic/integrity/PagesChecker.java
|
Code Review by Qodo
1.
|
| } | ||
|
|
||
| private static int romanToInteger(String s) { | ||
| Map<Character, Integer> va = Map.of( |
There was a problem hiding this comment.
I think this could be moved as a constant
There was a problem hiding this comment.
Sure! Already updated it.
InAnYan
left a comment
There was a problem hiding this comment.
While I'm not an expert in BibLaTeX standard, the code looks good and the tests don't fail
|
|
||
| private static int romanToInteger(String s) { | ||
| String roman = s.toUpperCase(); | ||
| int res = 0; |
There was a problem hiding this comment.
Please unabbreviate 'res'. Its not immediatley clear what that means
| boolean foundDecimal = decimalMatcher.find(); | ||
| int decimalStart = foundDecimal ? decimalMatcher.start() : -1; | ||
|
|
||
| boolean foundRoman = romanMatcher.find(); | ||
| int romanStart = foundRoman ? romanMatcher.start() : -1; |
There was a problem hiding this comment.
Please put a short comment here about why -1
There was a problem hiding this comment.
Hi, i will put it!
|
The error on CHANGELOG is related to JBang |
calixtus
left a comment
There was a problem hiding this comment.
Moving forward here. Thanks for your contribution

Related issues and pull requests
Closes #15457
PR Description
In this PR, i implemented the following features in page checker:
10-,-10,10--,--10,+10,10+-10;\\d*, which allows empty numbers, causing strings like "SS" to be considered as PREFIX and SUFFIX. Now the pattern is\\d+;Steps to test
biblatexin Library > Library Properties > General > Library ModeOptional Fieldstab.1/10, 2f., 2sqq, iv, iv-X, XX-C, ivxlcdmChecklist
CHANGELOG.mdin a way that can be understood by the average user (if change is visible to the user)