Fix mypy error by not using SpanGroup.__iter__()..

This commit is contained in:
Raphael Mitsch 2022-12-15 14:08:56 +01:00
parent b6bc6885d9
commit cdd5d69d60

View File

@ -507,7 +507,10 @@ def test_el_pipe_configuration(nlp):
kb: InMemoryLookupKB, mentions: Iterator[SpanGroup] kb: InMemoryLookupKB, mentions: Iterator[SpanGroup]
): ):
for doc_mentions in mentions: for doc_mentions in mentions:
yield [get_lowercased_candidates(kb, mention) for mention in doc_mentions] yield [
get_lowercased_candidates(kb, doc_mentions[idx])
for idx in range(len(doc_mentions))
]
@registry.misc("spacy.LowercaseCandidateGenerator.v1") @registry.misc("spacy.LowercaseCandidateGenerator.v1")
def create_candidates() -> Callable[ def create_candidates() -> Callable[