From 354afdc0b221faf60ff5cf0e0f2fa515827512f6 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 10 Jun 2020 20:31:54 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20dinglehopper:=20WIP=20data=20str?= =?UTF-8?q?ucture=20for=20extracted=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extracted_text.py | 4 ++-- extracted_text_test.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extracted_text.py b/extracted_text.py index 23cd519..c84c77b 100644 --- a/extracted_text.py +++ b/extracted_text.py @@ -4,14 +4,14 @@ import enum # TODO handle grapheme cluster positions? +# TODO Use type annotations for attr.ib types when support for Python 3.5 is dropped +# TODO types are not validated (attr does not do this yet) @attr.s(frozen=True) class ExtractedText: segments = attr.ib() joiner = attr.ib(type=str) - # XXX Use type annotations for attr types when support for Python 3.5 is dropped - # XXX Also I think these are not validated? @property def text(self): diff --git a/extracted_text_test.py b/extracted_text_test.py index 2e916cd..4919a76 100644 --- a/extracted_text_test.py +++ b/extracted_text_test.py @@ -6,7 +6,7 @@ from extracted_text import ExtractedText, ExtractedTextSegment def test_text(): test1 = ExtractedText([ ExtractedTextSegment('s0', 'foo'), - ExtractedTextSegment(1, 'bar'), + ExtractedTextSegment('s1', 'bar'), ExtractedTextSegment('s2', 'bazinga') ], ' ')