From 7179dd64365d41f46ab34a5eded3bc94ef3405d4 Mon Sep 17 00:00:00 2001 From: felixvd Date: Wed, 11 Feb 2015 01:54:41 +0900 Subject: [PATCH] Context sentence properly cut off at newline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The newline character is taken into account 20 lines earlier when looking for the start of the segment, but not when looking for its end. When lines don’t end in punctuation (e. g. notes taken in lectures), this could result in excessively long {sentence} fields. Former-commit-id: 8e25d2d2b7212c23e1a67c96055943c53aca4b36 --- yomi_base/reader_util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yomi_base/reader_util.py b/yomi_base/reader_util.py index 014263f..26ff3f2 100644 --- a/yomi_base/reader_util.py +++ b/yomi_base/reader_util.py @@ -70,7 +70,7 @@ def findSentence(content, position): if c in terminators: end = i + 1 break - elif c in quotesBwd: + elif (c in quotesBwd or c == '\n'): end = i break