Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion usaddress/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,9 @@ def parse(address_string: str) -> list[tuple[str, str]]:
return list(zip(tokens, tags))


def tag(address_string: str, tag_mapping=None) -> tuple[dict[str, str], str]:
def tag(
address_string: str, tag_mapping: typing.Optional[typing.Mapping[str, str]] = None
) -> tuple[dict[str, str], str]:
tagged_components: dict[str, list] = {}

last_label = None
Expand Down
4 changes: 3 additions & 1 deletion usaddress/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ def parse(address_string: str) -> list[tuple[str, str]]:
"""
...

def tag(address_string: str, tag_mapping=None) -> tuple[dict[str, str], str]:
def tag(
address_string: str, tag_mapping: typing.Optional[typing.Mapping[str, str]] = None
) -> tuple[dict[str, str], str]:
"""
Parse and merge consecutive components & strip commas.
Also return an address type (`Street Address`, `Intersection`, `PO Box`, or `Ambiguous`).
Expand Down