Skip to content

Commit 9f18c2c

Browse files
authored
Revert "Remove corus stubs" (#14158)
1 parent 7ee4d5b commit 9f18c2c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1155
-0
lines changed

pyrightconfig.stricter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"stubs/braintree",
3636
"stubs/cffi",
3737
"stubs/click-web",
38+
"stubs/corus",
3839
"stubs/dateparser",
3940
"stubs/defusedxml",
4041
"stubs/docker",

stubs/corus/METADATA.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version = "0.10.*"
2+
upstream_repository = "https://github.com/natasha/corus"
3+
4+
[tool.stubtest]
5+
# As of version 0.10.0, corus doesn't support Python 3.13.
6+
skip = true

stubs/corus/corus/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .sources import *

stubs/corus/corus/io.pyi

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from _typeshed import Incomplete
2+
from collections.abc import Generator
3+
4+
def match_names(records, pattern) -> Generator[Incomplete]: ...
5+
def rstrip(text): ...
6+
def load_text(path): ...
7+
def dump_text(text, path) -> None: ...
8+
def load_lines(path, encoding: str = "utf-8") -> Generator[Incomplete]: ...
9+
def parse_xml(text): ...
10+
def load_z_lines(path, open, encoding: str = "utf8") -> Generator[Incomplete]: ...
11+
def load_gz_lines(path): ...
12+
def load_bz2_lines(path): ...
13+
def load_xz_lines(path): ...
14+
def list_zip(path): ...
15+
def load_zip_lines(path, name, encoding: str = "utf8") -> Generator[Incomplete]: ...
16+
def load_zip_texts(path, names, encoding: str = "utf8") -> Generator[Incomplete]: ...
17+
def parse_csv(lines, delimiter: str = ",", max_field=None): ...
18+
def parse_tsv(lines): ...
19+
def skip_header(rows): ...
20+
def dict_csv(rows) -> Generator[Incomplete]: ...
21+
def parse_jsonl(lines) -> Generator[Incomplete]: ...

stubs/corus/corus/path.pyi

Whitespace-only changes.

stubs/corus/corus/readme.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from _typeshed import Incomplete
2+
from collections.abc import Generator
3+
4+
COMMANDS: Incomplete
5+
KB: int
6+
MB: Incomplete
7+
GB: Incomplete
8+
LABELS: Incomplete
9+
10+
def is_command(step, commands=("wget", "unzip", "unrar", "rm", "mv", "tar")): ...
11+
def format_bytes(value): ...
12+
def format_count(value): ...
13+
def unfold_metas(items) -> Generator[Incomplete]: ...
14+
def format_metas_(metas, nbviewer=None) -> Generator[Incomplete]: ...
15+
def format_metas(metas, url=None): ...
16+
def show_html(html) -> None: ...
17+
def patch_readme(html, path) -> None: ...

stubs/corus/corus/record.pyi

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from _typeshed import Incomplete
2+
3+
class Record:
4+
__attributes__: Incomplete
5+
def __eq__(self, other): ...
6+
def __ne__(self, other): ...
7+
def __iter__(self): ...
8+
def __hash__(self): ...
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
from .bsnlp import load_bsnlp as load_bsnlp
2+
from .buriy import *
3+
from .corpora import load_corpora as load_corpora
4+
from .factru import load_factru as load_factru
5+
from .gareev import load_gareev as load_gareev
6+
from .gramru import load_gramru as load_gramru
7+
from .lenta import load_lenta as load_lenta, load_lenta2 as load_lenta2
8+
from .librusec import load_librusec as load_librusec
9+
from .mokoron import *
10+
from .morphoru import *
11+
from .ne5 import load_ne5 as load_ne5
12+
from .ods import *
13+
from .omnia import load_omnia as load_omnia
14+
from .persons import load_persons as load_persons
15+
from .ria import *
16+
from .rudrec import load_rudrec as load_rudrec
17+
from .russe import *
18+
from .simlex import load_simlex as load_simlex
19+
from .taiga import *
20+
from .toloka import load_ruadrect as load_ruadrect, load_toloka_lrwc as load_toloka_lrwc
21+
from .ud import *
22+
from .wiki import load_wiki as load_wiki
23+
from .wikiner import load_wikiner as load_wikiner
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
from _typeshed import Incomplete
2+
from collections.abc import Generator
3+
4+
from corus.record import Record
5+
6+
RU: str
7+
BG: str
8+
CS: str
9+
PL: str
10+
LANGS: Incomplete
11+
ANNOTATED: str
12+
RAW: str
13+
TXT: str
14+
OUT: str
15+
16+
class BsnlpId(Record):
17+
__attributes__: Incomplete
18+
lang: Incomplete
19+
type: Incomplete
20+
name: Incomplete
21+
path: Incomplete
22+
def __init__(self, lang, type, name, path) -> None: ...
23+
24+
class BsnlpRaw(Record):
25+
__attributes__: Incomplete
26+
id: Incomplete
27+
name: Incomplete
28+
lang: Incomplete
29+
date: Incomplete
30+
url: Incomplete
31+
text: Incomplete
32+
def __init__(self, id, name, lang, date, url, text) -> None: ...
33+
34+
class BsnlpAnnotated(Record):
35+
__attributes__: Incomplete
36+
id: Incomplete
37+
name: Incomplete
38+
substrings: Incomplete
39+
def __init__(self, id, name, substrings) -> None: ...
40+
41+
class BsnlpSubstring(Record):
42+
__attributes__: Incomplete
43+
text: Incomplete
44+
normal: Incomplete
45+
type: Incomplete
46+
id: Incomplete
47+
def __init__(self, text, normal, type, id) -> None: ...
48+
49+
class BsnlpMarkup(Record):
50+
__attributes__: Incomplete
51+
id: Incomplete
52+
name: Incomplete
53+
lang: Incomplete
54+
date: Incomplete
55+
url: Incomplete
56+
text: Incomplete
57+
substrings: Incomplete
58+
def __init__(self, id, name, lang, date, url, text, substrings) -> None: ...
59+
60+
def walk(dir): ...
61+
def load_ids(dir, langs) -> Generator[Incomplete]: ...
62+
def select_type(ids, type) -> Generator[Incomplete]: ...
63+
64+
RAW_PATTERN: Incomplete
65+
66+
def parse_raw(name, text): ...
67+
def load_raw(records) -> Generator[Incomplete]: ...
68+
69+
ANNOTATED_PATTERN: Incomplete
70+
71+
def parse_substrings(lines) -> Generator[Incomplete]: ...
72+
def parse_annotated(name, lines): ...
73+
def load_annotated(records) -> Generator[Incomplete]: ...
74+
def merge(raw, annotated) -> Generator[Incomplete]: ...
75+
def load_bsnlp(dir, langs=["ru"]): ...
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from _typeshed import Incomplete
2+
3+
from corus.record import Record
4+
5+
__all__ = ["load_buriy_news", "load_buriy_webhose"]
6+
7+
class BuriyRecord(Record):
8+
__attributes__: Incomplete
9+
timestamp: Incomplete
10+
url: Incomplete
11+
edition: Incomplete
12+
topics: Incomplete
13+
title: Incomplete
14+
text: Incomplete
15+
def __init__(self, timestamp, url, edition, topics, title, text) -> None: ...
16+
17+
def load_buriy_news(path): ...
18+
def load_buriy_webhose(path): ...

0 commit comments

Comments
 (0)