Restructure and improve dialogue highlighting

This commit is contained in:
Veronica Berglyd Olsen
2024-11-04 17:28:21 +01:00
parent 843f8e0d39
commit 89f452f3fc
2 changed files with 58 additions and 36 deletions
+14 -4
View File
@@ -395,9 +395,9 @@ def testTextPatterns_DialogParserEnglish():
CONFIG.narratorBreak = nwUnicode.U_EMDASH
parser.initParser()
# Positions: 0 18 32 58
# Positions: 0 18 34 58
assert parser("“Simple dialogue, — argued John, — is not always so easy.”") == [
(0, 18), (32, 58),
(0, 18), (34, 58),
]
# Positions: 0 18 32 56
@@ -405,6 +405,11 @@ def testTextPatterns_DialogParserEnglish():
(0, 18), (32, 56),
]
# Positions: 0 31
assert parser("“Simple dialogue, —argued John”") == [
(0, 31),
]
@pytest.mark.core
def testTextPatterns_DialogParserSpanish():
@@ -462,9 +467,14 @@ def testTextPatterns_DialogParserPortuguese():
(0, 12),
]
# Positions: 0 12 27 49
# Positions: 0 12 29 49
assert parser("— Tudo bem? — ele pergunta. — Você falou com ele?") == [
(0, 12), (27, 49),
(0, 12), (29, 49),
]
# Positions: 0 12 29 49
assert parser("— Tudo bem? — ele pergunta —. Você falou com ele?") == [
(0, 12), (29, 49),
]