2022-10-06 11:51:06 +03:00
|
|
|
from typing import List, Optional, Iterable, Iterator, Union, Any, Tuple, overload
|
2021-08-07 13:30:03 +03:00
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
class StringStore:
|
2022-10-06 11:51:06 +03:00
|
|
|
def __init__(self, strings: Optional[Iterable[str]]) -> None: ...
|
2022-05-03 18:57:07 +03:00
|
|
|
@overload
|
2022-10-06 11:51:06 +03:00
|
|
|
def __getitem__(self, string_or_hash: str) -> int: ...
|
2022-05-03 18:57:07 +03:00
|
|
|
@overload
|
2022-10-06 11:51:06 +03:00
|
|
|
def __getitem__(self, string_or_hash: int) -> str: ...
|
|
|
|
def as_int(self, string_or_hash: Union[str, int]) -> int: ...
|
|
|
|
def as_string(self, string_or_hash: Union[str, int]) -> str: ...
|
2021-08-07 13:30:03 +03:00
|
|
|
def add(self, string: str) -> int: ...
|
2022-10-06 11:51:06 +03:00
|
|
|
def items(self) -> List[Tuple[str, int]]: ...
|
|
|
|
def keys(self) -> List[str]: ...
|
|
|
|
def values(self) -> List[int]: ...
|
2021-08-07 13:30:03 +03:00
|
|
|
def __len__(self) -> int: ...
|
2022-10-06 11:51:06 +03:00
|
|
|
def __contains__(self, string_or_hash: Union[str, int]) -> bool: ...
|
2021-08-07 13:30:03 +03:00
|
|
|
def __iter__(self) -> Iterator[str]: ...
|
|
|
|
def __reduce__(self) -> Any: ...
|
|
|
|
def to_disk(self, path: Union[str, Path]) -> None: ...
|
|
|
|
def from_disk(self, path: Union[str, Path]) -> StringStore: ...
|
|
|
|
def to_bytes(self, **kwargs: Any) -> bytes: ...
|
|
|
|
def from_bytes(self, bytes_data: bytes, **kwargs: Any) -> StringStore: ...
|
|
|
|
def _reset_and_load(self, strings: Iterable[str]) -> None: ...
|
2022-10-06 11:51:06 +03:00
|
|
|
|
|
|
|
def get_string_id(string_or_hash: Union[str, int]) -> int: ...
|