Reference

Class

RiTa

Name

kwic

Description Return a list of occurrences of the key word in the Key-Word-In-Context (KWIC) model.

Note: RiTa.concordance() must called before calling kwic().

Example

opts = {
ignoreCase: false,
ignoreStopWords: true
};

RiTa.concordance(text, opts);
lines = RiTa.kwic(word, numWords);

Parameters
Stringthe keyword of interest
intupper limit of words before/after the keyword (optional, default=6)
String[]options that can be set in Java

{String} options.text:
the text as the input of the KWIC model, you can set this option instead of calling RiTa.concordance() before RiTa.kwic(), if this option is set, it will overwrite the existing KWIC model

{String} options.words:
the words as the input of the KWIC model, you can set this option instead of calling RiTa.concordance() before RiTa.kwic(), if this option is set, it will overwrite the exist KWIC model

{int} options.numWords:
another way to set the numWords

{others} others:
if options.text or options.words is set, you can also set other concordance options for the model, please see RiTa.concordance() for detail
Returns
String[]all the occurrences of the keyword in the model, each with no more than 'numWords' words of context on either side
Note See KeyWordInContext and Concordance on Wikipedia
Syntax
RiTa.kwic(word);
RiTa.kwic(word, numWords);
// in Java only
RiTa.kwic(word, options)
Platform Java / JavaScript