From 1b9497dfb0a223c7679f63aff1e912513c313215 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 11 Jun 2020 14:50:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20dinglehopper:=20Test=20aligning?= =?UTF-8?q?=20by=20character=20while=20retaining=20segment=20id=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extracted_text_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extracted_text_test.py b/extracted_text_test.py index 60785b7..9eb57b6 100644 --- a/extracted_text_test.py +++ b/extracted_text_test.py @@ -52,6 +52,8 @@ def test_align(): for left, right in seq_align(grapheme_clusters(test1.text), grapheme_clusters(test2.text)): left_id = test1.segment_id_for_pos(left_pos) if left is not None else None right_id = test2.segment_id_for_pos(right_pos) if right is not None else None + # XXX note that deletions and inserts only produce one id + None, UI must + # support this, i.e. display for the one id produced el = AlignmentElement(left, right, left_id, right_id) alignment.append(el) if left is not None: