diff --git a/scripts/geodata/i18n/numex.py b/scripts/geodata/i18n/numex.py index c35e6449..4521052c 100644 --- a/scripts/geodata/i18n/numex.py +++ b/scripts/geodata/i18n/numex.py @@ -56,6 +56,8 @@ rule_type_map = { numex_rule_template = u'{{"{key}", (numex_rule_t){{{left_context_type}, {right_context_type}, {rule_type}, {gender}, {radix}, {value}LL}}}}' +stopword_rule_template = u'{{"{key}", NUMEX_STOPWORD_RULE}}' + ordinal_indicator_template = u'{{{number}, {gender}, "{value}"}}' stopwords_template = u'"{word}"' @@ -71,10 +73,6 @@ ordinal_indicator_t ordinal_indicator_rules[] = {{ {ordinal_indicator_rules} }}; -char *numex_stopwords[] = {{ - {stopwords} -}}; - numex_language_source_t numex_languages[] = {{ {languages} }}; @@ -101,7 +99,6 @@ def parse_numex_rules(dirname=NUMEX_DATA_DIR, outfile=NUMEX_RULES_FILE): rules = data.get('rules', []) rule_index = len(all_rules) - num_rules = len(rules) for rule in rules: gender = gender_map[rule.get('gender')] @@ -142,7 +139,9 @@ def parse_numex_rules(dirname=NUMEX_DATA_DIR, outfile=NUMEX_RULES_FILE): num_stopwords = len(stopwords) for stopword in stopwords: - all_stopwords.append(unicode(stopwords_template.format(word=stopword))) + all_rules.append(unicode(stopword_rule_template.format(key=stopword))) + + num_rules = len(rules) + len(stopwords) all_languages.append(unicode(language_template.format( language=language, diff --git a/src/numex_rule.h b/src/numex_rule.h index 9dc7d957..cd9b57b6 100644 --- a/src/numex_rule.h +++ b/src/numex_rule.h @@ -15,8 +15,6 @@ typedef struct numex_language_source { size_t num_rules; size_t ordinal_indicator_index; size_t num_ordinal_indicators; - size_t stopword_index; - size_t num_stopwords; } numex_language_source_t; #endif