Fix incorrect attribute access

This commit is contained in:
Guillaume Klein
2023-03-16 10:32:36 +01:00
parent 2007adf0b5
commit cce6b53e45

View File

@@ -668,8 +668,8 @@ def merge_punctuations(alignment: List[dict], prepended: str, appended: str):
following = alignment[j]
if previous["word"].startswith(" ") and previous["word"].strip() in prepended:
# prepend it to the following word
following["word"] = previous.word + following.word
following["tokens"] = previous.tokens + following.tokens
following["word"] = previous["word"] + following["word"]
following["tokens"] = previous["tokens"] + following["tokens"]
previous["word"] = ""
previous["tokens"] = []
else: