Skip to content

Commit

Permalink
older style optional
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Oct 25, 2024
1 parent 49b0000 commit 3594527
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions probablepeople/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _loadTagger(model_type: str) -> pycrfsuite.Tagger:
TAGGER = _loadTagger("generic")


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


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

prev_label = None
Expand Down

0 comments on commit 3594527

Please sign in to comment.