Skip to content

Commit 3594527

Browse files
committed
older style optional
1 parent 49b0000 commit 3594527

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

probablepeople/__init__.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _loadTagger(model_type: str) -> pycrfsuite.Tagger:
7676
TAGGER = _loadTagger("generic")
7777

7878

79-
def parse(raw_string: str, type: str | None = None) -> list[tuple[str, str]]:
79+
def parse(raw_string: str, type: typing.Optional[str] = None) -> list[tuple[str, str]]:
8080
if type is None:
8181
type = "generic"
8282
tagger = TAGGERS[type]
@@ -99,7 +99,9 @@ def parse(raw_string: str, type: str | None = None) -> list[tuple[str, str]]:
9999
return list(zip(tokens, tags))
100100

101101

102-
def tag(raw_string: str, type: str | None = None) -> tuple[dict[str, str], str]:
102+
def tag(
103+
raw_string: str, type: typing.optional[str] = None
104+
) -> tuple[dict[str, str], str]:
103105
tagged = {}
104106

105107
prev_label = None

0 commit comments

Comments
 (0)