From 1e030a51d44f2fcfed18abf4c10b7947734b0c1b Mon Sep 17 00:00:00 2001 From: gabriellima95 Date: Tue, 11 Sep 2018 15:27:39 -0300 Subject: [PATCH 1/2] Add Portuguese language to quotations --- talon/quotations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/talon/quotations.py b/talon/quotations.py index 996f79d..8ff852e 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -38,6 +38,8 @@ RE_ON_DATE_SMB_WROTE = re.compile( 'Op', # German 'Am', + # Portuguese + 'Em', # Norwegian u'På', # Swedish, Danish @@ -64,6 +66,8 @@ RE_ON_DATE_SMB_WROTE = re.compile( 'schreef','verzond','geschreven', # German 'schrieb', + # Portuguese + 'escreveu', # Norwegian, Swedish 'skrev', # Vietnamese From 7bd0e9cc2f9c7b0b50d622443afb57eba7a502c6 Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Fri, 21 Sep 2018 22:00:10 +0200 Subject: [PATCH 2/2] Fix catastrophic backtracking in regexp Co-Author: @Nipsuli --- talon/quotations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talon/quotations.py b/talon/quotations.py index 996f79d..51cf027 100644 --- a/talon/quotations.py +++ b/talon/quotations.py @@ -286,7 +286,7 @@ def process_marked_lines(lines, markers, return_flags=[False, -1, -1]): # inlined reply # use lookbehind assertions to find overlapping entries e.g. for 'mtmtm' # both 't' entries should be found - for inline_reply in re.finditer('(?<=m)e*((?:t+e*)+)m', markers): + for inline_reply in re.finditer('(?<=m)e*(t[te]*)m', markers): # long links could break sequence of quotation lines but they shouldn't # be considered an inline reply links = (