From 77eb12e3e78b757154d007265a6ad0b5885f0894 Mon Sep 17 00:00:00 2001 From: lotem Date: Mon, 29 Jul 2013 23:14:10 +0800 Subject: [PATCH] fix: table_translator not making sentence if table entry is hidden by charset filter. --- src/gear/table_translator.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gear/table_translator.cc b/src/gear/table_translator.cc index eaeb6e9b5..98f552592 100644 --- a/src/gear/table_translator.cc +++ b/src/gear/table_translator.cc @@ -248,9 +248,6 @@ shared_ptr TableTranslator::Query(const std::string &input, iter, uter); } - if (translation && translation->exhausted()) { - translation.reset(); // discard futile translation - } if (translation) { bool filter_by_charset = enable_charset_filter_ && !engine_->context()->get_option("extended_charset"); @@ -258,15 +255,18 @@ shared_ptr TableTranslator::Query(const std::string &input, translation = make_shared(translation); } } - if (enable_sentence_ && !translation) { - translation = MakeSentence(input, segment.start); - } if (translation && translation->exhausted()) { translation.reset(); // discard futile translation } + if (enable_sentence_ && !translation) { + translation = MakeSentence(input, segment.start); + } if (translation) { translation = make_shared(translation); } + if (translation && translation->exhausted()) { + translation.reset(); // discard futile translation + } return translation; }