Skip to content

Commit 369d839

Browse files
authored
Escape abbreviation before substitution
1 parent f953e71 commit 369d839

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pysbd/abbreviation_replacer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def replace_period_of_abbr(self, txt, abbr):
6565
txt = " " + txt
6666
txt = re.sub(
6767
r"(?<=\s{abbr})\.(?=((\.|\:|-|\?|,)|(\s([a-z]|I\s|I'm|I'll|\d|\())))".format(
68-
abbr=abbr.strip()
68+
abbr=re.escape(abbr.strip())
6969
),
7070
"∯",
7171
txt,

0 commit comments

Comments
 (0)