Skip to content

Commit eaf36dc

Browse files
committed
Added pyphen
1 parent 46b01bf commit eaf36dc

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

stubs/pyphen/METADATA.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version = "0.17.2"
2+
upstream-repository = "https://github.com/Kozea/Pyphen"

stubs/pyphen/pyphen/__init__.pyi

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from collections.abc import Generator
2+
from pathlib import Path
3+
from typing import Any
4+
from typing_extensions import Self
5+
6+
__all__ = ("LANGUAGES", "Pyphen", "language_fallback")
7+
LANGUAGES: dict[str, Path]
8+
9+
def language_fallback(language: str) -> str: ...
10+
11+
class AlternativeParser:
12+
change: str
13+
index: int
14+
cut: int
15+
16+
def __init__(self, pattern: str, alternative: str) -> None: ...
17+
def __call__(self, value: str) -> int: ...
18+
19+
class DataInt(int):
20+
def __new__(cls, value: int, data: Any = ..., reference: DataInt | None = ...) -> Self: ...
21+
22+
class HyphDict:
23+
patterns: dict[str, tuple[int, tuple[int, ...]]]
24+
cache: dict[str, list[DataInt]]
25+
maxlen: int
26+
27+
def __init__(self, path: Path) -> None: ...
28+
def positions(self, word: str) -> list[DataInt]: ...
29+
30+
class Pyphen:
31+
hd: HyphDict
32+
33+
def __init__(
34+
self, filename: str | Path | None = ..., lang: str | None = ..., left: int = 2, right: int = 2, cache: bool = True
35+
) -> None: ...
36+
def positions(self, word: str) -> list[DataInt]: ...
37+
def iterate(self, word: str) -> Generator[tuple[str, str], None, None]: ...
38+
def wrap(self, word: str, width: int, hyphen: str = "-") -> tuple[str, str] | None: ...
39+
def inserted(self, word: str, hyphen: str = "-") -> str: ...
40+
__call__ = iterate

0 commit comments

Comments
 (0)