Module
PhraseSuggester
PhraseSuggester ( name )
A suggester that suggests entire corrected phrases.
|
Method Summary
Returns | Name | Description |
---|---|---|
String | _type() | The type of ejs object. For internal use only. |
Object | analyzer(analyzer) | Sets analyzer used to analyze the suggest text. |
Object | confidence(c) | Sets the confidence level defines a factor applied to the input phrases score which is used as a threshold for other suggest candidates. Only candidates that score higher than the threshold will be included in the result. |
Object | directGenerator(oGenerator) | Adds a direct generator. If passed a single Generator
it is added to the list of existing generators. If passed an
array of Generators, they replace all existing generators. |
Object | field(field) | Sets the field used to generate suggestions from. |
Object | forceUnigrams(trueFalse) | Forces the use of unigrams. |
Object | gramSize(s) | Sets the max size of the n-grams (shingles) in the field. If the field doesn't contain n-grams (shingles) this should be omitted or set to 1. |
Object | highlight(preTag,postTag) | Enables highlighting of suggestions |
Object | laplaceSmoothing(alpha) | A smoothing model that uses an additive smoothing model where a constant (typically 1.0 or smaller) is added to all counts to balance weights, The default alpha is 0.5. |
Object | linearSmoothing(tl,bl,ul) | A smoothing model that takes the weighted mean of the unigrams, bigrams and trigrams based on user supplied weights (lambdas). The sum of tl, bl, and ul must equal 1. |
Object | maxErrors(c) | Sets the maximum percentage of the terms that at most considered to be misspellings in order to form a correction. |
Object | realWordErrorLikelihood(l) | Sets the likelihood of a term being a misspelled even if the term exists in the dictionary. The default it 0.95 corresponding to 5% or the real words are misspelled. |
Object | separator(sep) | Sets the separator that is used to separate terms in the bigram field. If not set the whitespce character is used as a separator. |
Object | shardSize(s) | Sets the maximum number of suggestions to be retrieved from each individual shard. |
Object | size(s) | Sets the number of suggestions returned for each token. |
Object | stupidBackoffSmoothing(discount) | A simple backoff model that backs off to lower order n-gram models if the higher order count is 0 and discounts the lower order n-gram model by a constant factor. The default discount is 0.4. |
Object | text(txt) | Sets the text to get suggestions for. If not set, the global suggestion text will be used. |
String | toJSON() | Retrieves the internal |
Object | tokenLimit(l) | Sets the token limit. |
Method Detail
analyzer
Object analyzer ( analyzer )
Sets analyzer used to analyze the suggest text.
|
confidence
Object confidence ( c )
Sets the confidence level defines a factor applied to the input phrases score which is used as a threshold for other suggest candidates. Only candidates that score higher than the threshold will be included in the result.
|
directGenerator
Object directGenerator ( oGenerator )
Adds a direct generator. If passed a single Generator
it is added to the list of existing generators. If passed an
array of Generators, they replace all existing generators.
|
field
Object field ( field )
Sets the field used to generate suggestions from.
|
forceUnigrams
Object forceUnigrams ( trueFalse )
Forces the use of unigrams.
|
gramSize
Object gramSize ( s )
Sets the max size of the n-grams (shingles) in the field. If the field doesn't contain n-grams (shingles) this should be omitted or set to 1.
|
highlight
Object highlight ( preTag, postTag )
Enables highlighting of suggestions
|
laplaceSmoothing
Object laplaceSmoothing ( alpha )
A smoothing model that uses an additive smoothing model where a constant (typically 1.0 or smaller) is added to all counts to balance weights, The default alpha is 0.5.
|
linearSmoothing
Object linearSmoothing ( tl, bl, ul )
A smoothing model that takes the weighted mean of the unigrams, bigrams and trigrams based on user supplied weights (lambdas). The sum of tl, bl, and ul must equal 1.
|
maxErrors
Object maxErrors ( c )
Sets the maximum percentage of the terms that at most considered to be misspellings in order to form a correction.
|
realWordErrorLikelihood
Object realWordErrorLikelihood ( l )
Sets the likelihood of a term being a misspelled even if the term exists in the dictionary. The default it 0.95 corresponding to 5% or the real words are misspelled.
|
separator
Object separator ( sep )
Sets the separator that is used to separate terms in the bigram field. If not set the whitespce character is used as a separator.
|
shardSize
Object shardSize ( s )
Sets the maximum number of suggestions to be retrieved from each individual shard.
|
size
Object size ( s )
Sets the number of suggestions returned for each token.
|
stupidBackoffSmoothing
Object stupidBackoffSmoothing ( discount )
A simple backoff model that backs off to lower order n-gram models if the higher order count is 0 and discounts the lower order n-gram model by a constant factor. The default discount is 0.4.
|
text
Object text ( txt )
Sets the text to get suggestions for. If not set, the global suggestion text will be used.
|
toJSON
String toJSON ( )
Retrieves the internal
|
tokenLimit
Object tokenLimit ( l )
Sets the token limit.
|