fix: Space support for halfwidthspaces

This commit is contained in:
Johanna Riedel
2024-12-08 14:40:56 +01:00
parent c46e9163e9
commit d3542de894
3 changed files with 11 additions and 6 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ class HalfwidthSpaces(SpanToken):
Insert halfwidth space into span token (Z. B.)
Identifies "z.B.", "d.h." and "D.h." with and without space in between.
"""
pattern = re.compile(r"\b(z|d|D)\.(B|h)\.")
pattern = re.compile(r"\b(z|Z|d|D)\.\s?(B|h)\.")
def __init__(self, match_object):
self.first = match_object.group(1)