Format page numbers, separated either by commas or double-hyphens.
Converts the range number format of the pages field to page_number--page_number.
Removes unwanted literals except letters, numbers and -+ signs.
Keeps the existing String if the resulting field does not match the expected Regex.
From BibTeX manual: One or more page numbers or range of numbers, such as 42--111 or 7,41,73--97 or 43+ (the '+' in this last example indicates pages following that don't form a simple range). To make it easier to maintain Scribe-compatible databases, the standard styles convert a single dash (as in 7-33) to the double dash used in TEX to denote number ranges (as in 7--33).
Examples:
1-2 -> 1--2
1---2 -> 1--2
1-2 -> 1--2
1,2,3 -> 1,2,3
{1}-{2} -> 1--2
43+ -> 43+
| Modifier and Type | Field and Description |
|---|---|
| private static final Pattern | |
| private static final Pattern | |
| private final Formatter |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public String | getDescription()
Implements abstract org. Returns a description of the formatter. |
| public String | getExampleInput()
Implements abstract org. Returns an example input string of the formatter. |
| public String | getKey()
Implements abstract org. Returns a unique key for the formatter that can be used for its identification |
| public String | getName()
Implements abstract org. Returns a human readable name of the formatter usable for e.g. in the GUI |
| DASHES_DETECT_PATTERN | back to summary |
|---|---|
| private static final Pattern DASHES_DETECT_PATTERN | |
| EM_EN_DASH_PATTERN | back to summary |
|---|---|
| private static final Pattern EM_EN_DASH_PATTERN | |
| unprotectTermsFormatter | back to summary |
|---|---|
| private final Formatter unprotectTermsFormatter | |
| NormalizePagesFormatter | back to summary |
|---|---|
| public NormalizePagesFormatter() | |
| format | back to summary |
|---|---|
public String format(@NonNull String value)
| |
| getDescription | back to summary |
|---|---|
| public String getDescription() Implements abstract org. Doc from org. Returns a description of the formatter.
| |
| getExampleInput | back to summary |
|---|---|
| public String getExampleInput() Implements abstract org. Doc from org. Returns an example input string of the formatter. This example is used as input to the formatter to demonstrate its functionality
| |
| getKey | back to summary |
|---|---|
| public String getKey() Implements abstract org. Doc from org. Returns a unique key for the formatter that can be used for its identification
| |
| getName | back to summary |
|---|---|
| public String getName() Implements abstract org. Doc from org. Returns a human readable name of the formatter usable for e.g. in the GUI
| |