new Phrases()
The Phrases tool shows repeating sequences of words organized by frequency of repetition or number of words in each repeated phrase.
- Tutorials:
Example
let config = {
"columns": null,
"dir": null,
"docId": null,
"docIndex": null,
"maxLength": null,
"minLength": null,
"overlapFilter": null,
"query": null,
"sort": null,
"stopList": null
};
loadCorpus("austen").tool("phrases", config);
Members
-
columns
-
Properties:
Name Type Description columns
columns 'term', 'rawFreq', 'length', 'distributions'
-
dir
-
Properties:
Name Type Default Description dir
String desc The direction in which to sort the results: 'asc' or 'desc'
-
docId
-
Properties:
Name Type Description docId
String | Array.<String> The document ID(s) to restrict the results to.
-
docIndex
-
Properties:
Name Type Description docIndex
Number | Array.<Number> The document index(es) to restrict the results to.
-
maxLength
-
Properties:
Name Type Default Description maxLength
Number 50 The maximum length (number of words) of the phrase to consider.
-
minLength
-
Properties:
Name Type Default Description minLength
Number 2 The minimum length (number of words) of the phrase to consider.
-
overlapFilter
-
Properties:
Name Type Default Description overlapFilter
String length Specifies the strategory for prioritizing and filtering out phrases. Options are: 'none' (no filtering), 'length' (prioritize phrase length), or 'rawFreq' (prioritize phrase frequency). See Phrases options for more info.
-
query
-
Properties:
Name Type Description query
String | Array.<String> A query or array of queries (queries can be separated by a comma). For query syntax, see the search documentation.
-
sort
-
Properties:
Name Type Default Description sort
String length The column to sort the results by
-
stopList
-
Properties:
Name Type Default Description stopList
String auto A comma-separated list of words, a named list or a URL to a plain text list, one word per line. By default this is set to 'auto' which auto-detects the document's language and loads an appropriate list (if available for that language). Set this to blank to not use the default stopList. For more information see the Stopwords documentation.