KWIC concordance¶
kwic(keyword, text="", path=null, window=5, by_lemma=false, limit=50)
All occurrences of a word or a phrase with the context on the left and on the right - a concordance the agent quotes the text by and sees how a word is used. Words are compared ignoring case, and the written accent is part of a word: «solo» does not find «sólo». With by_lemma words are compared by the lemmas of esMorph in the context of the sentence: «razón» finds «razones», and a word of the query is taken by any lemma of its analyses, so «vino» finds both the wine and the forms of venir. A phrase does not run across the end of a sentence. The texts of a query link are searched one by one: a line names its text, and the context does not run into the next one. How occurrences are found is described on the esTS page KWIC concordance.
The lines are limited by the limit parameter and by the size of the response - about 40,000 characters of lines; if not all occurrences are shown, a warning tells how many there are.
Errors - those common to the tools and a keyword without words.
{
"name": "kwic",
"arguments": {
"keyword": "razón",
"text": "La razón de la sinrazón que a mi razón se hace, de tal manera mi razón enflaquece, que con razón me quejo de la vuestra fermosura. Y también cuando leía: ...los altos cielos que de vuestra divinidad divinamente con las estrellas os fortifican, y os hacen merecedora del merecimiento que merece la vuestra grandeza.\n\nCon estas razones perdía el pobre caballero el juicio, y desvelábase por entenderlas y desentrañarles el sentido, que no se lo sacara ni las entendiera el mesmo Aristóteles, si resucitara para sólo ello.",
"window": 3,
"by_lemma": true
}
}
{
"n_matches": 5,
"matches": [
{"left": "La", "keyword": "razón", "right": "de la sinrazón"},
{"left": "que a mi", "keyword": "razón", "right": "se hace, de"},
{"left": "tal manera mi", "keyword": "razón", "right": "enflaquece, que con"},
{"left": "enflaquece, que con", "keyword": "razón", "right": "me quejo de"},
{"left": "grandeza. Con estas", "keyword": "razones", "right": "perdía el pobre"}
],
"warnings": []
}
Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
keyword |
string |
- | Word or phrase |
text |
string |
"" |
Text |
path |
string |
null |
Absolute path to a file with the text or a link ests://datasets/... instead of text |
window |
integer |
5 |
Number of context words on each side, up to 50 |
by_lemma |
boolean |
false |
Find all forms of the word by its lemma |
limit |
integer |
50 |
Greatest number of lines in the response, up to 500 |
Result¶
| Field | Type | Description |
|---|---|---|
n_matches |
integer |
Number of occurrences |
matches |
array[object] |
Lines in the order of the text: the left context left, the occurrence keyword as written in the text and the right context right; a line of a query link with several texts also has the link path and the title title of its text |
warnings |
array[string] |
The text is not in Spanish, not all occurrences are shown, there are no occurrences of a word form |