seboettg / citeproc-php

Full-featured CSL 1.0.1 processor for PHP
MIT License
73 stars 38 forks source link

NumberHelper::PATTERN_ORDINAL matching to many cases, therefore is_numeric is sometimes true but should be false #117

Closed urshofer closed 2 years ago

urshofer commented 2 years ago

Please follow the general troubleshooting steps first:

Bug reports:

const PATTERN_ORDINAL = "/\d+(st|nd|rd|th)?\.?$/";

is matching too many cases, therefore setting is_numeric to true in cases it should be false. This leads to an additional "st.ed" after edition, but "1st ed. 1985" is not numeric.

Barbier, Frédéric. "L'industrialisation Des Techniques". In Histoire De l'édition française: Le Temps Des Editeurs; Du Romantisme À La Belle Epoque, Roger Chartier and Henri-Jean Martin, 51-66, 1st ed. 1985st ed. Paris: Fayard/Cercle de la Librairie, 1990.

Used CSL stylesheet:

chicago-fullnote-bibliography-16th-edition.csl

Used CSL metadata

[
   {
    "author": [
        {
            "given": "Frédéric",
            "family": "Barbier"
        }
    ],
    "container-author": [
        {
            "given": "Roger",
            "family": "Chartier"
        },
        {
            "given": "Henri-Jean",
            "family": "Martin"
        }
    ],
    "container-title": "Histoire de l’édition française: Le temps des éditeurs; Du romantisme à la Belle Époque",
    "edition": "1st ed. 1985",
    "type": "chapter",
    "id": "barbier_lindustrialisation_1990",
    "citation-label": "barbier_lindustrialisation_1990",
    "issued": {
        "date-parts": [
            [
                1990
            ]
        ]
    },
    "page": "51-66",
    "publisher-place": "Paris",
    "publisher": "Fayard/Cercle de la Librairie",
    "title": "L’industrialisation des techniques",
    "volume": "3"
}
]