Dataset texts¶
find_texts(dataset, author=null, genre=null, theme=null, category=null, text_type=null, title=null, grade=null, volume=null, year=null, year_from=null, year_to=null, min_len=null, max_len=null, limit=20, offset=0)
A search for texts in the ruTS datasets: a reference for keyness and compare_texts or a sample for analyze_text without searching the web. The texts themselves are not in the response: the tool returns links to them, and the links are passed to path, reference_path, a_paths and b_paths of any tool instead of a file path. The link ruts://datasets/<dataset>/<number> is one text. The query link ruts://datasets/<dataset>?<filters> is all the texts found. analyze_text and collocations take them as one text, and analyze_text with per_text gives a table of statistics for every text with a summary over the corpus. kwic, dispersion and keyness tell the texts apart: a concordance line names its text, the texts are the parts of the dispersion, phrases do not run from one text into another. In a_paths and b_paths of compare_texts they are separate texts of the corpus. The length of the texts together - query_chars in the response - is limited by the server limit on a text max_text_length. A text longer than the limit (a novel of russian_literature) is taken in parts: the response gives its number of parts parts, and the link to a part is ruts://datasets/<dataset>/<number>?part=<k>.
| Dataset | What it contains | Filters | On disk |
|---|---|---|---|
texts_by_grade |
68 texts labelled with a school grade or university year (Plain Russian Language) | grade |
1 MB |
sov_chrest_lit |
179 texts of the «Родная речь» reader for grade 1 | author, category, text_type, grade, year |
1 MB |
stalin_works |
1243 texts of the complete works of J.V. Stalin | text_type, volume, year |
19 MB |
poetry_corpus |
16,694 poems by 195 poets of the 18th-20th centuries | author, theme, year_from, year_to |
26 MB |
russian_literature |
373 works by 12 classics of the 19th - early 20th century | author, genre, year_from, year_to |
90 MB |
All datasets have the title filter title - a part of the title ignoring case and ё - and the length filters min_len and max_len. A filter the dataset does not have gives an error listing the available ones. text_type is an exact value from the list of the dataset («Рассказ», «Доклад»), a wrong value gives an error with this list. A text that repeats one already found (there are 288 of them in poetry_corpus) is left out of the response. If nothing is found, warnings names the themes or sections of the dataset and the authors with the same surname; offset gives the next page of the response. The stanzas are not marked in the texts of poetry_corpus, and the verse group sees a poem as one stanza: the analyze_text response warns about it. The descriptions of the datasets and their licenses are on the ruTS page Datasets.
The datasets are not part of the package or of the Docker image. A dataset is downloaded by ruts-mcp download <dataset> (several datasets separated by spaces), and the ruts://datasets resource shows what is downloaded. How to mount datasets into the image is described in Server over HTTP.
Errors are the ones common to the tools, a dataset not downloaded, a filter the dataset does not have and a wrong filter value.
Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
dataset |
string |
- | Dataset: texts_by_grade, sov_chrest_lit, stalin_works, poetry_corpus, russian_literature |
author |
string |
null |
Author, a part of the name ignoring case and ё |
genre |
string |
null |
Genre of russian_literature: prose, poems, publicism, drama |
theme |
string |
null |
Theme of poetry_corpus: «О любви», «Военные», «О природе» |
category |
string |
null |
Section of sov_chrest_lit: «Весна», «Зима» |
text_type |
string |
null |
Text type of sov_chrest_lit and stalin_works: «Рассказ», «Статья» |
title |
string |
null |
A part of the title of a text ignoring case and ё, in all datasets |
grade |
integer |
null |
Grade for texts_by_grade and sov_chrest_lit |
volume |
integer |
null |
Volume of stalin_works |
year |
integer |
null |
Year for sov_chrest_lit and stalin_works |
year_from |
integer |
null |
Earliest year for poetry_corpus and russian_literature |
year_to |
integer |
null |
Latest year for poetry_corpus and russian_literature |
min_len |
integer |
null |
Least text length in characters |
max_len |
integer |
null |
Greatest text length in characters |
limit |
integer |
20 |
Number of texts in the response, up to 200 |
offset |
integer |
0 |
How many texts found to skip: the next page of the response |
Result¶
| Field | Type | Description |
|---|---|---|
dataset |
string |
Dataset |
n_found |
integer |
How many texts were found |
query |
string |
Link to all the texts found |
query_chars |
integer |
Length of all the texts found together in characters |
max_text_length |
integer |
The server limit on a text in characters (RUTS_MCP_MAX_TEXT_LENGTH) |
texts |
array[object] |
limit texts after the first offset: the link path, the fields of the dataset record (author, title, years, genre, grade), the length n_chars in characters and, for a text longer than the limit, the number of parts parts |
warnings |
array[string] |
Hints if nothing is found and how many texts are left beyond the page |