PHP Class Elastica\Suggest\Phrase

Inheritance: extends AbstractSuggest
ファイルを表示 Open project: ruflin/elastica Class Usage Examples

Public Methods

Method Description
addCandidateGenerator ( Elastica\Suggest\CandidateGenerator\AbstractCandidateGenerator $generator )
setAnalyzer ( string $analyzer )
setConfidence ( float $confidence ) Set the factor applied to the input phrases score to be used as a threshold for other suggestion candidates.
setGramSize ( integer $size ) Set the max size of the n-grams (shingles) in the field.
setHighlight ( string $preTag, string $postTag ) Set suggestion highlighting.
setLaplaceSmoothing ( float $alpha = 0.5 )
setLinearInterpolationSmoothing ( float $trigramLambda, float $bigramLambda, float $unigramLambda )
setMaxErrors ( float $max ) Set the maximum percentage of the terms considered to be misspellings in order to form a correction.
setRealWordErrorLikelihood ( float $likelihood ) Set the likelihood of a term being misspelled even if the term exists in the dictionary.
setSeparator ( string $separator )
setSmoothingModel ( string $model, array $params )
setStupidBackoffSmoothing ( float $discount = 0.4 )
toArray ( )

Method Details

addCandidateGenerator() public method

public addCandidateGenerator ( Elastica\Suggest\CandidateGenerator\AbstractCandidateGenerator $generator )
$generator Elastica\Suggest\CandidateGenerator\AbstractCandidateGenerator

setAnalyzer() public method

public setAnalyzer ( string $analyzer )
$analyzer string

setConfidence() public method

Only candidates which score higher than this threshold will be included in the result.
public setConfidence ( float $confidence )
$confidence float Defaults to 1.0.

setGramSize() public method

Set the max size of the n-grams (shingles) in the field.
public setGramSize ( integer $size )
$size integer

setHighlight() public method

Set suggestion highlighting.
public setHighlight ( string $preTag, string $postTag )
$preTag string
$postTag string

setLaplaceSmoothing() public method

public setLaplaceSmoothing ( float $alpha = 0.5 )
$alpha float

setLinearInterpolationSmoothing() public method

public setLinearInterpolationSmoothing ( float $trigramLambda, float $bigramLambda, float $unigramLambda )
$trigramLambda float
$bigramLambda float
$unigramLambda float

setMaxErrors() public method

Set the maximum percentage of the terms considered to be misspellings in order to form a correction.
public setMaxErrors ( float $max )
$max float

setRealWordErrorLikelihood() public method

Set the likelihood of a term being misspelled even if the term exists in the dictionary.
public setRealWordErrorLikelihood ( float $likelihood )
$likelihood float Defaults to 0.95, meaning 5% of the words are misspelled.

setSeparator() public method

public setSeparator ( string $separator )
$separator string

setSmoothingModel() public method

public setSmoothingModel ( string $model, array $params )
$model string the name of the smoothing model
$params array

setStupidBackoffSmoothing() public method

public setStupidBackoffSmoothing ( float $discount = 0.4 )
$discount float

toArray() public method

public toArray ( )