new CorpusTerms()
Corpus Terms tool, a grid that shows the terms in the corpus. You can work with corpus terms programmatically using Spyral.Corpus#terms.
- Tutorials:
Example
let config = {
columns: null,
comparisonCorpus: null,
dir: null,
maxBins: null,
query: null,
sort: null,
stopList: null,
termColors: null
};
loadCorpus("austen").tool("corpusterms", config);
Members
-
columns
-
Properties:
Name Type Description columnscolumns 'term', 'rawFreq', 'relativeFreq', 'relativePeakedness', 'relativeSkewness', 'comparisonRelativeFreqDifference', 'distributions'
-
comparisonCorpus
-
Properties:
Name Type Description comparisonCorpusString An existing corpus to be used for comparison purposes.
None of the columns visible by default use comparisonCorpus so this is an advanced parameter used when the "Comparison" column is shown. The comparison column shows the relative frequency of the term in the corpus compared to the relative frequency of the same term in a comparison corpus.
-
dir
-
Properties:
Name Type Description dirString The direction in which to sort the results: 'asc' or 'desc'
-
height
-
Properties:
Name Type Description heightNumber The display height of the tool in pixels. -
maxBins
-
Properties:
Name Type Default Description maxBinsNumber 100 The maximum number of bins to use for distributions in Trend.
By default this is set to 100 (in other words, if there are more than 100 documents in the corpus, they will be forced into 100 bins). Higher values are possible but it can cause performance issues and necessitate more data transfer (values for each one of the bins for each one of the terms).
-
query
-
Properties:
Name Type Description queryString | 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 Description sortString The column to sort the results by
-
stopList
-
Properties:
Name Type Default Description stopListString 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.
-
style
-
Properties:
Name Type Description styleString A string of CSS properties to use as the style attribute for the tool's parent tag. -
termColors
-
Properties:
Name Type Default Description termColorsString categories Which term colors to show in the grid. By default this is set to 'categories' which shows the term color only if it's been assigned by a category. The other alternatives are 'terms' which shows all terms colors, and '' or undefined which shows no term colors.
-
width
-
Properties:
Name Type Description widthNumber The display width of the tool in pixels.