Analysis of a Spanish text
analyze_textMeasures Spanish texts with exact readability, diversity, morphology, syntax, meter, rhyme, cohesion, style and phonology statistics, returning values, interpretations and warnings.
Instructions
Measure a Spanish text with the statistics of the esTS library.
Use it to get exact numbers about a text instead of judging it by eye. Only the requested groups are computed. Pass a text from a file through path instead of sending it whole: this is faster, and the statistics are computed on the original text.
Statistic groups:
basic: sentences, words, syllables, characters, letters, spaces and punctuation marks; unique, long (7 or more letters), complex (3 or more syllables), simple, monosyllabic and polysyllabic words with their share of all words; entropy of word lengths in letters and syllables.
readability: readability - the consensus grade and the formulas for Spanish: the Flesch reading ease with the coefficients of the preset (Szigriszt-Pazos or Fernández Huerta), Gutiérrez de Polini, Crawford, Legibilidad µ, SOL, LIX, RIX and the reading time; the grade formulas, the consensus grade and RIX are read as a school stage of Spain and the reader age, the reading ease, Legibilidad µ and LIX as a band of their scales, Gutiérrez de Polini and the reading time have no scale.
diversity: lexical diversity - TTR and its corrections, MATTR, MSTTR, MTLD, HD-D, the indices of Simpson, Yule and Honoré, Orlov's Z, entropy, the laws of Zipf and Heaps, burstiness of frequent words.
morph: morphology by esMorph in the context of the sentence - parts of speech and 15 grammatical features (the number and share of words with each value) and the shares of the forms that mark the register: the moods among the finite forms (the imperative under-reported), the infinitive, gerund and participle, verb forms with clitics after and before them, ser against estar, adverbs in -mente, diminutives.
phon: phonostatistics by the transcription in the pronunciation of Spain - shares of vowels, sonorants, voiced and voiceless obstruents, the ratio of consonants to vowels, heavy consonant clusters, hiatuses inside words and at the junctions of words, junctions of 4 or more consonants, entropy of the CV patterns, hardness, open syllables and syllable length, alliteration and assonance indices.
cohesion: cohesion in the manner of Coh-Metrix - repetition of nouns, arguments and content words between sentences (adjacent, all pairs, the next two) and between adjacent paragraphs (a paragraph is a line of the text, with blank_lines a part between blank lines), pronouns and demonstratives, givenness, repetition of tense and mood, connectors per 1000 words - between and inside sentences, by class (causal, adversative, concessive, temporal, additive, conditional, reformulative) and kind.
lexical: lexical sophistication by the frequencies of the language - share of the words found in the frequency dictionary of Google Books Ngram, mean frequency (ipm) and its logarithm, range and dispersion over the years, surprisal and perplexity, shares of the words among the 1000-10,000 most frequent lemmas, lexical density, shares of proper nouns and abbreviations. The metrics by the dictionary need it downloaded.
verse: verse - lines and stanzas, the syllabic meter and its metrical syllables counted with synalephas and the law of the final stress, lines off the meter and without its rhythmic stresses, the share of rhymed lines (consonante or asonante; with seseo by the option seseo) and the rhyme schemes, aguda, llana and esdrújula endings, the strophes of the stanzas and the form of the poem (soneto, romance, silva). No dictionary is needed: the stresses come from the spelling.
syntax: syntax by the dependency tree of esSyntax - dependency lengths, depth and shape of the tree, words before the root, verb valency, clauses, subordinate and infinitive clauses, the indices of L2SCA (T-units, verb phrases, coordinate phrases, complex nominals), coordination chains, noun modifiers, prepositional chains and chains of de (el aumento de la eficiencia del uso de los recursos), participial and gerund clauses, the passive with ser and with se, impersonal se, infinitives, negations, split predicates (llevar a cabo, hacer una revisión), the order of subjects and objects, similarity of adjacent sentences, the ratio of nouns to verbs. The parser overestimates the passive with se and underestimates the impersonal se: read the two together.
style: SEO metrics over word forms - classic and academic nausea, water, spam and naturalness by Zipf's law, with no norms for Spanish (compare texts with each other), the most frequent word forms and the most frequent significant words the academic nausea is computed from, lexical markers of the administrative style with the words and phrases found: verbal nouns, compound prepositions, parenthetical expressions, clichés. The syntactic markers of the administrative style - split predicates, chains of de, the passive, participial and gerund clauses, the ratio of nouns to verbs - are in the group syntax: to check a text for the administrative style take style and syntax.
unadapted_readability: readability formulas of English, German and Italian with their original coefficients - FORCAST, Linsear Write, Powers-Sumner-Kearl, EFLAW, the four Wiener Sachtextformeln, Dickes-Steiwer, Gulpease, Fucks, Strain, ELF, Wheeler-Smith; they give no Spanish grade and compare Spanish texts with each other and with other tools.
The result has a key for every requested group: a statistic with its value "value", its share "share" or its interpretation by a scale "interpretation", if it has them, and its description "description" - what it computes; the markers of the administrative style of the group style also have the number of occurrences "count" and the words and phrases found "found". The value null means the statistic is undefined on this text. The key "warnings" lists the reasons why the values may be unstable or make no sense for this text: a short text, a text not in Spanish, a dictionary not downloaded (then the warning names the command that downloads it). Read the warnings before drawing conclusions. With per_text the response is "per_text" instead of the groups: "rows" - a row for every text (the link "path", the title "title", the values by the keys «group.key»), "summary" - a summary over the corpus: for numbers the number of texts "n", the mean "mean", the smallest "min" and the largest "max", for strings (the meter) "n" and the frequencies of the values "counts", for dictionaries (parts of speech, rhyme schemes) "n" and the summed frequencies "totals", up to 20 most frequent; a text where the group does not give the statistic has null. The rows are limited to 40 thousand characters, and then a warning says how many are shown, while the summary covers all the texts. The warnings of the texts come once each with the number of texts that have them, and the numbers that differ in them as a range.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "analyze_text"
}
}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 | |
| seseo | No | Read the rhyme with seseo (group verse): z, and c before e and i, rhyme with s, as in Andalusia, the Canary Islands and America (voz - dos, taza - casa); for a poet who rhymes so | |
| groups | No | Statistic groups; each is a key of the result | |
| per_text | No | Statistics «group.key» of every text of a query link to a dataset in path (verse.meter, readability.consensus_grade): the response is a table of the texts with these values and a summary over the corpus instead of the groups; groups are not needed then | |
| blank_lines | No | A paragraph is a part of the text between blank lines, not a line (group cohesion): for a text whose lines are wrapped inside its paragraphs | |
| descriptions | No | Add the descriptions to the statistics; false - a shorter response when the descriptions are already known from a previous call | |
| distributions | No | Add the distributions of words by number of letters and syllables and of punctuation marks by type (group basic) | |
| readability_preset | No | Coefficients of the Flesch reading ease and the scale that reads it and turns it into a grade (group readability): general - Szigriszt-Pazos with the INFLESZ scale, the usual choice for any text; classic - Fernández Huerta with his bands, for comparison with studies and tools that use his formula. Without a particular reason keep general | general |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||