Skip to content

Commit 77eb12e

Browse files
committed
fix: table_translator not making sentence if table entry is hidden by charset filter.
1 parent 1a34848 commit 77eb12e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/gear/table_translator.cc

+6-6
Original file line numberDiff line numberDiff line change
@@ -248,25 +248,25 @@ shared_ptr<Translation> TableTranslator::Query(const std::string &input,
248248
iter,
249249
uter);
250250
}
251-
if (translation && translation->exhausted()) {
252-
translation.reset(); // discard futile translation
253-
}
254251
if (translation) {
255252
bool filter_by_charset = enable_charset_filter_ &&
256253
!engine_->context()->get_option("extended_charset");
257254
if (filter_by_charset) {
258255
translation = make_shared<CharsetFilter>(translation);
259256
}
260257
}
261-
if (enable_sentence_ && !translation) {
262-
translation = MakeSentence(input, segment.start);
263-
}
264258
if (translation && translation->exhausted()) {
265259
translation.reset(); // discard futile translation
266260
}
261+
if (enable_sentence_ && !translation) {
262+
translation = MakeSentence(input, segment.start);
263+
}
267264
if (translation) {
268265
translation = make_shared<UniqueFilter>(translation);
269266
}
267+
if (translation && translation->exhausted()) {
268+
translation.reset(); // discard futile translation
269+
}
270270
return translation;
271271
}
272272

0 commit comments

Comments
 (0)