citation-style-language / documentation

Citation Style Language documentation
http://citationstyles.org/
Creative Commons Attribution Share Alike 4.0 International
43 stars 21 forks source link

Ambiguity in is-numeric #75

Open ndw opened 4 years ago

ndw commented 4 years ago

The description of is-numeric reads:

Tests whether the given variables (Appendix IV - Variables) contain numeric content. Content is considered numeric if it solely consists of numbers. Numbers may have prefixes and suffixes (“D2”, “2b”, “L2d”), and may be separated by a comma, hyphen, or ampersand, with or without spaces (“2, 3”, “2-4”, “2 & 4”). For example, “2nd” tests “true” whereas “second” and “2nd edition” test “false”.

That doesn't clearly answer the question "when is a hyphen a separator and when is it part of a suffix?"

Consider "1234-abcd". If the hyphen is part of the suffix then that is numeric. If it isn't, then it's a separator in which case the test is against ("1234", "abcd") and since "abcd" isn't a number, it isn't numeric.