Charts of a text
visualizeDraw charts of Spanish texts—Zipf, Heaps, spectrum, sentence lengths, dispersion, fingerprinting, rhythm—with a PNG image and numerical summary for clearer distribution analysis.
Instructions
Draw a chart of a text with the visualizers of esTS: a PNG image and a short summary in numbers.
Use it when a distribution is clearer shown than retold: the user sees the image, and the summary gives the numbers for conclusions. The charts chart:
zipf: Zipf's law - the frequencies of the words by rank on a logarithmic scale with the Zipf-Mandelbrot fit; the summary - the slope and the most frequent words.
heaps: Heaps' law - the growth of the number of unique words with the length of the text; the summary - the exponent of the law.
spectrum: frequency spectrum - how many unique words occur 1, 2, 3 and more times; the summary - the share of hapaxes.
sentence_lengths: the lengths of the sentences in order with the moving average and the distribution; the summary - the number, the mean, the smallest and the largest length and the window of the moving average (2% of the sentences, at least 10), if the line is drawn: a text shorter than 10 sentences has none.
dispersion: the places of the words words (lemmas) in the text; the summary - the frequency and Gries's DP of every word.
fingerprinting: literary fingerprinting - the TTR of the moving segments in color, showing the places where the vocabulary is poorer or richer; the summary - MATTR.
rhythm: the rhythm of a verse - the lines as rows of metrical syllables with the stressed ones; the summary - the number of lines and the meter, and for prose and a text without a meter a warning that the picture says nothing about the meter.
The labels of the charts are in English. The result is the image and the text of the summary; the last lines of the summary are warnings if the text is not in Spanish.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"chart": "<chart>"
},
"name": "visualize"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Absolute path to a UTF-8 text file on the machine where the server runs, or a link ests://datasets/... from find_texts, instead of text: a long text need not be sent in the argument | |
| text | No | Text in Spanish; path can be given instead | |
| chart | Yes | Chart (see the description of the tool) | |
| width | No | Width of the image in pixels | |
| words | No | Words for chart=dispersion, up to 10 | |
| height | No | Height of the image in pixels |