Skip to content
Merged
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
1 change: 1 addition & 0 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"stubs/braintree",
"stubs/cffi",
"stubs/click-web",
"stubs/corus",
"stubs/dateparser",
"stubs/defusedxml",
"stubs/docker",
Expand Down
6 changes: 6 additions & 0 deletions stubs/corus/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version = "0.10.*"
upstream_repository = "https://github.com/natasha/corus"

[tool.stubtest]
# As of version 0.10.0, corus doesn't support Python 3.13.
skip = true
1 change: 1 addition & 0 deletions stubs/corus/corus/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .sources import *
21 changes: 21 additions & 0 deletions stubs/corus/corus/io.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from _typeshed import Incomplete
from collections.abc import Generator

def match_names(records, pattern) -> Generator[Incomplete]: ...
def rstrip(text): ...
def load_text(path): ...
def dump_text(text, path) -> None: ...
def load_lines(path, encoding: str = "utf-8") -> Generator[Incomplete]: ...
def parse_xml(text): ...
def load_z_lines(path, open, encoding: str = "utf8") -> Generator[Incomplete]: ...
def load_gz_lines(path): ...
def load_bz2_lines(path): ...
def load_xz_lines(path): ...
def list_zip(path): ...
def load_zip_lines(path, name, encoding: str = "utf8") -> Generator[Incomplete]: ...
def load_zip_texts(path, names, encoding: str = "utf8") -> Generator[Incomplete]: ...
def parse_csv(lines, delimiter: str = ",", max_field=None): ...
def parse_tsv(lines): ...
def skip_header(rows): ...
def dict_csv(rows) -> Generator[Incomplete]: ...
def parse_jsonl(lines) -> Generator[Incomplete]: ...
Empty file added stubs/corus/corus/path.pyi
Empty file.
17 changes: 17 additions & 0 deletions stubs/corus/corus/readme.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from _typeshed import Incomplete
from collections.abc import Generator

COMMANDS: Incomplete
KB: int
MB: Incomplete
GB: Incomplete
LABELS: Incomplete

def is_command(step, commands=("wget", "unzip", "unrar", "rm", "mv", "tar")): ...
def format_bytes(value): ...
def format_count(value): ...
def unfold_metas(items) -> Generator[Incomplete]: ...
def format_metas_(metas, nbviewer=None) -> Generator[Incomplete]: ...
def format_metas(metas, url=None): ...
def show_html(html) -> None: ...
def patch_readme(html, path) -> None: ...
8 changes: 8 additions & 0 deletions stubs/corus/corus/record.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from _typeshed import Incomplete

class Record:
__attributes__: Incomplete
def __eq__(self, other): ...
def __ne__(self, other): ...
def __iter__(self): ...
def __hash__(self): ...
23 changes: 23 additions & 0 deletions stubs/corus/corus/sources/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from .bsnlp import load_bsnlp as load_bsnlp
from .buriy import *
from .corpora import load_corpora as load_corpora
from .factru import load_factru as load_factru
from .gareev import load_gareev as load_gareev
from .gramru import load_gramru as load_gramru
from .lenta import load_lenta as load_lenta, load_lenta2 as load_lenta2
from .librusec import load_librusec as load_librusec
from .mokoron import *
from .morphoru import *
from .ne5 import load_ne5 as load_ne5
from .ods import *
from .omnia import load_omnia as load_omnia
from .persons import load_persons as load_persons
from .ria import *
from .rudrec import load_rudrec as load_rudrec
from .russe import *
from .simlex import load_simlex as load_simlex
from .taiga import *
from .toloka import load_ruadrect as load_ruadrect, load_toloka_lrwc as load_toloka_lrwc
from .ud import *
from .wiki import load_wiki as load_wiki
from .wikiner import load_wikiner as load_wikiner
75 changes: 75 additions & 0 deletions stubs/corus/corus/sources/bsnlp.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
from _typeshed import Incomplete
from collections.abc import Generator

from corus.record import Record

RU: str
BG: str
CS: str
PL: str
LANGS: Incomplete
ANNOTATED: str
RAW: str
TXT: str
OUT: str

class BsnlpId(Record):
__attributes__: Incomplete
lang: Incomplete
type: Incomplete
name: Incomplete
path: Incomplete
def __init__(self, lang, type, name, path) -> None: ...

class BsnlpRaw(Record):
__attributes__: Incomplete
id: Incomplete
name: Incomplete
lang: Incomplete
date: Incomplete
url: Incomplete
text: Incomplete
def __init__(self, id, name, lang, date, url, text) -> None: ...

class BsnlpAnnotated(Record):
__attributes__: Incomplete
id: Incomplete
name: Incomplete
substrings: Incomplete
def __init__(self, id, name, substrings) -> None: ...

class BsnlpSubstring(Record):
__attributes__: Incomplete
text: Incomplete
normal: Incomplete
type: Incomplete
id: Incomplete
def __init__(self, text, normal, type, id) -> None: ...

class BsnlpMarkup(Record):
__attributes__: Incomplete
id: Incomplete
name: Incomplete
lang: Incomplete
date: Incomplete
url: Incomplete
text: Incomplete
substrings: Incomplete
def __init__(self, id, name, lang, date, url, text, substrings) -> None: ...

def walk(dir): ...
def load_ids(dir, langs) -> Generator[Incomplete]: ...
def select_type(ids, type) -> Generator[Incomplete]: ...

RAW_PATTERN: Incomplete

def parse_raw(name, text): ...
def load_raw(records) -> Generator[Incomplete]: ...

ANNOTATED_PATTERN: Incomplete

def parse_substrings(lines) -> Generator[Incomplete]: ...
def parse_annotated(name, lines): ...
def load_annotated(records) -> Generator[Incomplete]: ...
def merge(raw, annotated) -> Generator[Incomplete]: ...
def load_bsnlp(dir, langs=["ru"]): ...
18 changes: 18 additions & 0 deletions stubs/corus/corus/sources/buriy.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from _typeshed import Incomplete

from corus.record import Record

__all__ = ["load_buriy_news", "load_buriy_webhose"]

class BuriyRecord(Record):
__attributes__: Incomplete
timestamp: Incomplete
url: Incomplete
edition: Incomplete
topics: Incomplete
title: Incomplete
text: Incomplete
def __init__(self, timestamp, url, edition, topics, title, text) -> None: ...

def load_buriy_news(path): ...
def load_buriy_webhose(path): ...
50 changes: 50 additions & 0 deletions stubs/corus/corus/sources/corpora.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
from _typeshed import Incomplete
from collections.abc import Generator

from corus.record import Record

class CorporaText(Record):
__attributes__: Incomplete
id: Incomplete
parent_id: Incomplete
name: Incomplete
tags: Incomplete
pars: Incomplete
def __init__(self, id, parent_id, name, tags, pars) -> None: ...

class CorporaPar(Record):
__attributes__: Incomplete
id: Incomplete
sents: Incomplete
def __init__(self, id, sents) -> None: ...

class CorporaSent(Record):
__attributes__: Incomplete
id: Incomplete
text: Incomplete
tokens: Incomplete
def __init__(self, id, text, tokens) -> None: ...

class CorporaToken(Record):
__attributes__: Incomplete
id: Incomplete
rev_id: Incomplete
text: Incomplete
forms: Incomplete
def __init__(self, id, rev_id, text, forms) -> None: ...

class CorporaForm(Record):
__attributes__: Incomplete
id: Incomplete
text: Incomplete
grams: Incomplete
def __init__(self, id, text, grams) -> None: ...

def parse_grams(xml) -> Generator[Incomplete]: ...
def parse_forms(xml) -> Generator[Incomplete]: ...
def parse_tokens(xml) -> Generator[Incomplete]: ...
def parse_sents(xml) -> Generator[Incomplete]: ...
def parse_pars(xml) -> Generator[Incomplete]: ...
def parse_tags(xml) -> Generator[Incomplete]: ...
def parse_text(xml): ...
def load_corpora(path) -> Generator[Incomplete]: ...
74 changes: 74 additions & 0 deletions stubs/corus/corus/sources/factru.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
from _typeshed import Incomplete
from collections.abc import Generator

from corus.record import Record

DEVSET: str
TESTSET: str
TXT: str
SPANS: str
OBJECTS: str
COREF: str
FACTS: str

class FactruSpan(Record):
__attributes__: Incomplete
id: Incomplete
type: Incomplete
start: Incomplete
stop: Incomplete
def __init__(self, id, type, start, stop) -> None: ...

class FactruObject(Record):
__attributes__: Incomplete
id: Incomplete
type: Incomplete
spans: Incomplete
def __init__(self, id, type, spans) -> None: ...

class FactruCorefSlot(Record):
__attributes__: Incomplete
type: Incomplete
value: Incomplete
def __init__(self, type, value) -> None: ...

class FactruCoref(Record):
__attributes__: Incomplete
id: Incomplete
objects: Incomplete
slots: Incomplete
def __init__(self, id, objects, slots) -> None: ...

class FactruFactSlot(Record):
__attributes__: Incomplete
type: Incomplete
ref: Incomplete
value: Incomplete
def __init__(self, type, ref, value) -> None: ...

class FactruFact(Record):
__attributes__: Incomplete
id: Incomplete
type: Incomplete
slots: Incomplete
def __init__(self, id, type, slots) -> None: ...

class FactruMarkup(Record):
__attributes__: Incomplete
id: Incomplete
text: Incomplete
objects: Incomplete
corefs: Incomplete
facts: Incomplete
def __init__(self, id, text, objects, corefs, facts) -> None: ...

def list_ids(dir, set) -> Generator[Incomplete]: ...
def part_path(id, dir, set, part): ...
def parse_spans(lines) -> Generator[Incomplete]: ...
def parse_objects(lines, spans) -> Generator[Incomplete]: ...
def parse_coref_slots(lines) -> Generator[Incomplete]: ...
def parse_corefs(lines, objects) -> Generator[Incomplete]: ...
def parse_facts_slots(lines, id_corefs, id_spans) -> Generator[Incomplete]: ...
def parse_facts(lines, corefs, spans) -> Generator[Incomplete]: ...
def load_id(id, dir, set): ...
def load_factru(dir, sets=["devset", "testset"]) -> Generator[Incomplete]: ...
21 changes: 21 additions & 0 deletions stubs/corus/corus/sources/gareev.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from _typeshed import Incomplete
from collections.abc import Generator

from corus.record import Record

class GareevToken(Record):
__attributes__: Incomplete
text: Incomplete
tag: Incomplete
def __init__(self, text, tag) -> None: ...

class GareevRecord(Record):
__attributes__: Incomplete
tokens: Incomplete
def __init__(self, tokens) -> None: ...

def parse_conll(lines) -> Generator[Incomplete]: ...
def parse_gareev(lines): ...
def load_id(id, dir): ...
def list_ids(dir) -> Generator[Incomplete]: ...
def load_gareev(dir) -> Generator[Incomplete]: ...
1 change: 1 addition & 0 deletions stubs/corus/corus/sources/gramru.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
def load_gramru(path): ...
19 changes: 19 additions & 0 deletions stubs/corus/corus/sources/lenta.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from _typeshed import Incomplete
from collections.abc import Generator

from corus.record import Record

class LentaRecord(Record):
__attributes__: Incomplete
url: Incomplete
title: Incomplete
text: Incomplete
topic: Incomplete
tags: Incomplete
date: Incomplete
def __init__(self, url, title, text, topic, tags, date=None) -> None: ...

def parse_lenta(lines) -> Generator[Incomplete]: ...
def parse_lenta2(lines) -> Generator[Incomplete]: ...
def load_lenta(path): ...
def load_lenta2(path): ...
14 changes: 14 additions & 0 deletions stubs/corus/corus/sources/librusec.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from _typeshed import Incomplete
from collections.abc import Generator

from corus.record import Record

class LibrusecRecord(Record):
__attributes__: Incomplete
id: Incomplete
text: Incomplete
def __init__(self, id, text) -> None: ...

def flush(id, buffer): ...
def parse_librusec(lines) -> Generator[Incomplete]: ...
def load_librusec(path): ...
Loading