Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Fix "ấn" + "]" should return "ấn]", not "aans]" in non-VN mode
Browse files Browse the repository at this point in the history
Since "]" is a proper IM key, the check will pass and the fallback
sequence will be returned.
  • Loading branch information
lewtds committed Mar 29, 2013
1 parent f2fc054 commit 7aeb7bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bogo/bogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def default_return():
# The prefix "_" means undo.
for trans in map(lambda x: "_" + x, trans_list):
new_comps = transform(new_comps, trans)

# TODO refactor
if config["input-method"] == "telex" and \
len(fallback_sequence) >= 1 and \
Expand All @@ -173,7 +173,7 @@ def default_return():

logging.debug("%s, %s", utils.join(new_comps), fallback_sequence)

if config['skip-non-vietnamese'] == True and (key.isalpha() or key in im) and \
if config['skip-non-vietnamese'] == True and key.isalpha() and \
not is_valid_combination(new_comps, final_form=False):
return fallback_sequence, fallback_sequence
else:
Expand Down
3 changes: 2 additions & 1 deletion test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_undo(self):
def test_non_vn(self):
def atomic(word):
eq_(process_seq(word, config=c_non_vn), word)

tests = [
"system",
"Virtualbox",
Expand All @@ -162,6 +162,7 @@ def atomic(word):
yield atomic, test

eq_(process_seq_non_vn("aans."), "ấn.")
eq_(process_seq_non_vn("aans]"), "ấn]")
# eq_(process_seq_non_vn("aans.tuongwj"), "ấn.tượng")
eq_(process_seq_non_vn("gi[f"), "giờ")
eq_(process_seq_non_vn("taojc"), "taojc")

0 comments on commit 7aeb7bd

Please sign in to comment.