From 0b5a44090fda627963d8b3dd4683c9cfa96231e6 Mon Sep 17 00:00:00 2001 From: Hung Nguyen Date: Mon, 10 Jul 2017 11:18:57 +0700 Subject: [PATCH 1/2] add support for Vietnamese reply format --- talon/quotations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/talon/quotations.py b/talon/quotations.py index 9286209..7eb16ad 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -42,6 +42,8 @@ RE_ON_DATE_SMB_WROTE = re.compile( u'På', # Swedish, Danish 'Den', + # Vietnamese + u'Vào', )), # Date and sender separator u'|'.join(( @@ -64,6 +66,8 @@ RE_ON_DATE_SMB_WROTE = re.compile( 'schrieb', # Norwegian, Swedish 'skrev', + # Vietnamese + u'đã viết', )) )) # Special case for languages where text is translated like this: 'on {date} wrote {somebody}:' From b8e1894f3bb39d26db50762e92876c85200644f5 Mon Sep 17 00:00:00 2001 From: Hung Nguyen Date: Mon, 10 Jul 2017 13:28:33 +0700 Subject: [PATCH 2/2] add test case --- tests/text_quotations_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/text_quotations_test.py b/tests/text_quotations_test.py index c02c375..4163774 100644 --- a/tests/text_quotations_test.py +++ b/tests/text_quotations_test.py @@ -401,6 +401,14 @@ Op 17-feb.-2015, om 13:18 heeft Julius Caesar het volgende g Small batch beard laboris tempor, non listicle hella Tumblr heirloom. """)) +def test_vietnamese_from_block(): + eq_('Hello', quotations.extract_from_plain( + u"""Hello + +Vào 14:24 8 tháng 6, 2017, Hùng Nguyễn đã viết: + +> Xin chào +""")) def test_quotation_marker_false_positive(): msg_body = """Visit us now for assistance...