From 9bdf11842340ac1ee9a143131d3b407041dbc2ac Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 3 Jun 2015 22:58:29 -0400 Subject: [PATCH] [transliteration] Fix to transliteration in cases where the pre/post context doesn't match and we fall back to the no-context match --- src/transliterate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transliterate.c b/src/transliterate.c index 84a44095..a8b5f646 100644 --- a/src/transliterate.c +++ b/src/transliterate.c @@ -396,7 +396,7 @@ static trie_prefix_result_t context_match(trie_t *trie, char *str, transliterati log_debug("Have pre_context\n"); state = check_pre_context(trie, str, prev_state); - if (state.state == TRANS_STATE_MATCH) { + if (state.state == TRANS_STATE_MATCH && state.result.node_id != prev_state.result.node_id) { return state.result; } @@ -409,7 +409,7 @@ static trie_prefix_result_t context_match(trie_t *trie, char *str, transliterati prev_state.result = result; log_debug("Have post_context\n"); state = check_post_context(trie, str, prev_state); - if (state.state == TRANS_STATE_MATCH) { + if (state.state == TRANS_STATE_MATCH && state.result.node_id != prev_state.result.node_id) { return state.result; } }