[numex] Using the new representation for generated data

This commit is contained in:
Al
2015-06-02 12:28:07 -04:00
parent 958c219b88
commit 4ad978f22c
3 changed files with 5 additions and 6 deletions

View File

@@ -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}
}};

View File

@@ -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"

View File

@@ -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