Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b9ac866ea7 | ||
|
|
678517dd89 | ||
|
|
a2aa345712 | ||
|
|
d998beaff3 | ||
|
|
a379bc4e7c | ||
|
|
b8e1894f3b | ||
|
|
0b5a44090f | ||
|
|
b40835eca2 | ||
|
|
b38562c7cc | ||
|
|
70e9fb415e | ||
|
|
64612099cd | ||
|
|
e16dcf629e |
2
setup.py
2
setup.py
@@ -29,7 +29,7 @@ class InstallCommand(install):
|
|||||||
|
|
||||||
|
|
||||||
setup(name='talon',
|
setup(name='talon',
|
||||||
version='1.4.0',
|
version='1.4.3',
|
||||||
description=("Mailgun library "
|
description=("Mailgun library "
|
||||||
"to extract message quotations and signatures."),
|
"to extract message quotations and signatures."),
|
||||||
long_description=open("README.rst").read(),
|
long_description=open("README.rst").read(),
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ def cut_microsoft_quote(html_message):
|
|||||||
#outlook 2007, 2010 (american)
|
#outlook 2007, 2010 (american)
|
||||||
"//div[@style='border:none;border-top:solid #B5C4DF 1.0pt;"
|
"//div[@style='border:none;border-top:solid #B5C4DF 1.0pt;"
|
||||||
"padding:3.0pt 0in 0in 0in']|"
|
"padding:3.0pt 0in 0in 0in']|"
|
||||||
|
#outlook 2013 (international)
|
||||||
|
"//div[@style='border:none;border-top:solid #E1E1E1 1.0pt;"
|
||||||
|
"padding:3.0pt 0cm 0cm 0cm']|"
|
||||||
|
#outlook 2013 (american)
|
||||||
|
"//div[@style='border:none;border-top:solid #E1E1E1 1.0pt;"
|
||||||
|
"padding:3.0pt 0in 0in 0in']|"
|
||||||
#windows mail
|
#windows mail
|
||||||
"//div[@style='padding-top: 5px; "
|
"//div[@style='padding-top: 5px; "
|
||||||
"border-top-color: rgb(229, 229, 229); "
|
"border-top-color: rgb(229, 229, 229); "
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ RE_ON_DATE_SMB_WROTE = re.compile(
|
|||||||
u'På',
|
u'På',
|
||||||
# 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}:'
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ RE_REVERSE_SIGNATURE = re.compile(r'''
|
|||||||
|
|
||||||
def is_signature_line(line, sender, classifier):
|
def is_signature_line(line, sender, classifier):
|
||||||
'''Checks if the line belongs to signature. Returns True or False.'''
|
'''Checks if the line belongs to signature. Returns True or False.'''
|
||||||
data = numpy.array(build_pattern(line, features(sender)))
|
data = numpy.array(build_pattern(line, features(sender))).reshape(1, -1)
|
||||||
return classifier.predict(data) > 0
|
return classifier.predict(data) > 0
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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...
|
||||||
|
|||||||
Reference in New Issue
Block a user