1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-06-09 11:50:00 +02:00

🐛 dinglehopper: Fix alto_extract_lines()'s type annotation

This commit is contained in:
Gerber, Mike 2020-11-12 19:32:38 +01:00
parent fe3923a8af
commit 389e253c11

View file

@ -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")