[numex] Using the new representation for generated data
This commit is contained in:
@@ -54,7 +54,7 @@ rule_type_map = {
|
||||
'ordinal': ORDINAL
|
||||
}
|
||||
|
||||
numex_rule_template = u'{{"{key}", {rule_type}, {gender}, {left_context_type}, {right_context_type}, {value}LL, {radix}}}'
|
||||
numex_rule_template = u'{{"{key}", (numex_rule_t){{{left_context_type}, {right_context_type}, {rule_type}, {gender}, {radix}, {value}LL}}}}'
|
||||
|
||||
ordinal_indicator_template = u'{{{number}, {gender}, "{value}"}}'
|
||||
|
||||
@@ -67,7 +67,7 @@ numex_rule_source_t numex_rules[] = {{
|
||||
{numex_rules}
|
||||
}};
|
||||
|
||||
ordinal_indicator_rule_t ordinal_indicator_rules[] = {{
|
||||
ordinal_indicator_t ordinal_indicator_rules[] = {{
|
||||
{ordinal_indicator_rules}
|
||||
}};
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ extern "C" {
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "collections.h"
|
||||
#include "constants.h"
|
||||
#include "string_utils.h"
|
||||
#include "tokens.h"
|
||||
#include "collections.h"
|
||||
|
||||
#define DEFAULT_NUMEX_PATH LIBPOSTAL_DATA_DIR "/numex/numex.dat"
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "collections.h"
|
||||
#include "constants.h"
|
||||
#include "klib/khash.h"
|
||||
#include "string_utils.h"
|
||||
#include "trie.h"
|
||||
@@ -76,9 +77,6 @@ typedef struct transliteration_table {
|
||||
cstring_array *revisit_strings;
|
||||
} transliteration_table_t;
|
||||
|
||||
#define NAMESPACE_SEPARATOR_CHAR "|"
|
||||
#define NAMESPACE_SEPARATOR_CHAR_LEN strlen(NAMESPACE_SEPARATOR_CHAR)
|
||||
|
||||
// Control characters are special
|
||||
#define WORD_BOUNDARY_CHAR "\x01"
|
||||
#define WORD_BOUNDARY_CODEPOINT 1
|
||||
|
||||
Reference in New Issue
Block a user