Merge pull request #147 from hnx116/master

add support for Vietnamese reply format
This commit is contained in:
Sergey Obukhov
2017-07-10 11:40:04 -07:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -42,6 +42,8 @@ RE_ON_DATE_SMB_WROTE = re.compile(
u'', u'',
# Swedish, Danish # Swedish, Danish
'Den', 'Den',
# Vietnamese
u'Vào',
)), )),
# Date and sender separator # Date and sender separator
u'|'.join(( u'|'.join((
@@ -64,6 +66,8 @@ RE_ON_DATE_SMB_WROTE = re.compile(
'schrieb', 'schrieb',
# Norwegian, Swedish # Norwegian, Swedish
'skrev', 'skrev',
# Vietnamese
u'đã viết',
)) ))
)) ))
# Special case for languages where text is translated like this: 'on {date} wrote {somebody}:' # Special case for languages where text is translated like this: 'on {date} wrote {somebody}:'

View File

@@ -401,6 +401,14 @@ Op 17-feb.-2015, om 13:18 heeft Julius Caesar <pantheon@rome.com> het volgende g
Small batch beard laboris tempor, non listicle hella Tumblr heirloom. 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 <hungnguyen@xxx.com> đã viết:
> Xin chào
"""))
def test_quotation_marker_false_positive(): def test_quotation_marker_false_positive():
msg_body = """Visit us now for assistance... msg_body = """Visit us now for assistance...