mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 03:23:50 +00:00
python: Mark regexes as raw strings.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
84db245e3f
commit
96fbe060a6
@@ -166,10 +166,10 @@ IGNORED_PHRASES.sort(key=len, reverse=True)
|
||||
# text using BeautifulSoup and then removes extra whitespaces from
|
||||
# it. This step enables us to add HTML in our regexes directly.
|
||||
COMPILED_IGNORED_PHRASES = [
|
||||
re.compile(" ".join(BeautifulSoup(regex, "lxml").text.split())) for regex in IGNORED_PHRASES
|
||||
re.compile(r" ".join(BeautifulSoup(regex, "lxml").text.split())) for regex in IGNORED_PHRASES
|
||||
]
|
||||
|
||||
SPLIT_BOUNDARY = "?.!" # Used to split string into sentences.
|
||||
SPLIT_BOUNDARY = r"?.!" # Used to split string into sentences.
|
||||
SPLIT_BOUNDARY_REGEX = re.compile(rf"[{SPLIT_BOUNDARY}]")
|
||||
|
||||
# Regexes which check capitalization in sentences.
|
||||
|
||||
Reference in New Issue
Block a user