[numex] changing is_roman_numeral to is_likely_roman_numeral to get rid of most of the false positives like \"La\" in Spanish which could be L(=50) + the ordinal suffix \"a\", but in practice it never means that. For Roman numerals that are shorter than two characters (whether on their own like "DC" or "MD", or attached to a potential ordinal suffix like \"Ce\" in French), will be ignored unless they're composed of more likely, smaller, Roman numerals: I, V, and X, so VI, IX, etc. are expanded as Roman numerals but LI is not.

This commit is contained in:
Al
2017-12-27 19:27:23 -05:00
parent b17b2bdcc4
commit b4fdc51bf9
2 changed files with 98 additions and 59 deletions

View File

@@ -152,8 +152,8 @@ numex_result_array *convert_numeric_expressions(char *str, char *lang);
size_t ordinal_suffix_len(char *s, size_t len, char *lang);
size_t possible_ordinal_digit_len(char *str, size_t len);
bool is_roman_numeral(char *str);
bool is_roman_numeral_len(char *str, size_t len);
bool is_likely_roman_numeral(char *str);
bool is_likely_roman_numeral_len(char *str, size_t len);
bool numex_table_write(FILE *file);
bool numex_table_save(char *filename);