PHP Class TextAnalysis\Indexes\WordnetIndex

Author: yooper
显示文件 Open project: yooper/php-text-analysis

Protected Properties

Property Type Description
$lemmasIdx array
$wordnetCorpus TextAnalysis\Corpus\WordnetCorpus

Public Methods

Method Description
__construct ( WordnetCorpus $wordnetCorpus )
__destruct ( )
getLemma ( string $word, string $pos = '' ) : Lemma[] Return the lemmas that are linked to the given word, provide a pos to filter down the results
getMorph ( string $word, string | null $pos = '' ) : string Concept taken from nltk Find a possible base form for the given form, with the given part of speech, by checking WordNet's list of exceptional forms, and by recursively stripping affixes for this part of speech until a form in WordNet is found.
getMorphilogicalSubstitutions ( ) : array
getWordnetCorpus ( ) : WordnetCorpus

Method Details

__construct() public method

public __construct ( WordnetCorpus $wordnetCorpus )
$wordnetCorpus TextAnalysis\Corpus\WordnetCorpus

__destruct() public method

public __destruct ( )

getLemma() public method

Return the lemmas that are linked to the given word, provide a pos to filter down the results
public getLemma ( string $word, string $pos = '' ) : Lemma[]
$word string
$pos string
return TextAnalysis\Models\Wordnet\Lemma[]

getMorph() public method

Concept taken from nltk Find a possible base form for the given form, with the given part of speech, by checking WordNet's list of exceptional forms, and by recursively stripping affixes for this part of speech until a form in WordNet is found.
public getMorph ( string $word, string | null $pos = '' ) : string
$word string
$pos string | null
return string return the base word

getMorphilogicalSubstitutions() public method

getWordnetCorpus() public method

public getWordnetCorpus ( ) : WordnetCorpus
return TextAnalysis\Corpus\WordnetCorpus

Property Details

$lemmasIdx protected_oe property

protected array $lemmasIdx
return array

$wordnetCorpus protected_oe property

protected WordnetCorpus,TextAnalysis\Corpus $wordnetCorpus
return TextAnalysis\Corpus\WordnetCorpus