Text charts¶
visualize(chart, text="", path=null, words=[], width=800, height=500)
A chart of a text by the esTS visualizers: the response is a PNG image and a short summary in numbers. The agent shows the image to the user and draws conclusions from the summary: a distribution is easier to see than to read a retelling of. Chart labels are in English. The visualizers are described in the esTS section «Visualizers», starting with the page Zipf's law.
chart |
What the chart shows | Summary |
|---|---|---|
zipf |
Zipf's law: word frequencies by rank on a logarithmic scale with a Zipf-Mandelbrot fit | The slope zipf_alpha and the most frequent words |
heaps |
Heaps' law: the growth of the number of distinct words with the length of the text | The exponent heaps_beta |
spectrum |
Frequency spectrum: how many distinct words occur 1, 2, 3 and more times | The share of hapaxes hapax_ratio |
sentence_lengths |
Sentence lengths in order with a moving average and the distribution | The number of sentences, the mean and median length, its standard deviation, the smallest and greatest length; the moving average window is 2 % of the sentences, at least 10, there is no line for a text shorter than the window |
dispersion |
The places of the words in the text: every occurrence is a stroke |
The frequency and Gries' DP of every word (see dispersion) |
fingerprinting |
Literature fingerprinting: the TTR of sliding segments as colour, the places where the vocabulary is poorer or richer | MATTR |
rhythm |
The rhythm of a verse: lines as rows of metrical syllables, counted with synalephas and the law of the final stress, stressed ones highlighted | The number of lines and the meter; for prose and a text without a meter - a warning that the picture says nothing about the meter |
The numbers of the summary are the same as in the diversity and verse groups of analyze_text, with the same descriptions and the warning about a too short text; dispersion adds the warnings of the dispersion tool. The words for dispersion are compared as lemmas, as in the dispersion tool. No chart needs downloaded data.
Errors are the ones common to the tools, a text without words and dispersion without words.

The summary of this chart: «Sentences: 37; words per sentence - mean 50.76, median 42, standard deviation 27.51, smallest 4, largest 125; the line is the moving average over 10 sentences».
Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
chart |
string |
- | Chart: zipf, heaps, spectrum, sentence_lengths, dispersion, fingerprinting, rhythm |
text |
string |
"" |
Text |
path |
string |
null |
Absolute path to a file with the text or a link ests://datasets/... instead of text |
words |
array[string] |
[] |
Words for dispersion, up to 10 |
width |
integer |
800 |
Image width in pixels, from 400 to 1200 |
height |
integer |
500 |
Image height in pixels, from 300 to 900 |
Result¶
A PNG image of the given size and the text of the summary. The last lines of the summary are warnings if the text is not in Spanish.