Reference

Class

RiTa

Name

RiTa.concordance

Description Creates a concordance, a list of words with their frequency of occurence, from the given text and (optional) options
Syntax
RiTa.concordance(text, args);
Parameters
Stringthe text
Stringthe word to lookup
Object
(or Map in Java)
options (optional) the relevant options for the KWIK model:

{int} options.wordCount:
# of words of context on either side of input word

{boolean} options.ignoreCase:
Ignore upper/lower case in the model

{boolean} options.ignoreStopWords:
Ignore words like 'the', 'and', 'a', 'of', etc, as specified in RiTa.STOP_WORDS

{boolean} options.ignorePunctuation:
Ignore punctuation tokens in the model

{String[]} options.wordsToIgnore:
A set of words (alternative stop-words, for example) to ignore.

Returns
Object
(or Map in Java)
the concordance
Note See https://en.wikipedia.org/wiki/Concordance_%28publishing%29
Example
// Java

Map args = new HashMap();
args.put("ignoreCase", false);
args.put("ignoreStopWords", true);

String c = RiTa.concordance(text, args);


// Javascript

var args = {
ignoreCase: false,
ignoreStopWords: true
};

var c = RiTa.concordance(text, args);

Platform Java / Javascript