From 389e253c11c042a569dd4b279ede8c44ac7d18c2 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 12 Nov 2020 19:32:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20dinglehopper:=20Fix=20alto=5Fext?= =?UTF-8?q?ract=5Flines()'s=20type=20annotation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/dinglehopper/ocr_files.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qurator/dinglehopper/ocr_files.py b/qurator/dinglehopper/ocr_files.py index aded486..4045680 100644 --- a/qurator/dinglehopper/ocr_files.py +++ b/qurator/dinglehopper/ocr_files.py @@ -1,6 +1,6 @@ from __future__ import division, print_function -from typing import Generator +from typing import Iterator from warnings import warn import sys @@ -23,7 +23,7 @@ def alto_namespace(tree: ET.ElementTree) -> str: raise ValueError("Not an ALTO tree") -def alto_extract_lines(tree: ET.ElementTree) -> Generator[ExtractedText, None, None]: +def alto_extract_lines(tree: ET.ElementTree) -> Iterator[ExtractedText]: nsmap = {"alto": alto_namespace(tree)} for line in tree.iterfind(".//alto:TextLine", namespaces=nsmap): line_id = line.attrib.get("ID")