PHP Class TextAnalysis\Corpus\WordnetCorpus

Author: yooper
Inheritance: extends ReadCorpusAbstract
显示文件 Open project: yooper/php-text-analysis Class Usage Examples

Protected Properties

Property Type Description
$exceptionsMap TextAnalysis\Models\Wordnet\ExceptionMap[]
$lemmas TextAnalysis\Models\Wordnet\Lemma[]
$lexNames stores all the lex names
$posFileMaps map part of speech character to its definition
$synsets TextAnalysis\Models\Wordnet\Synset[] An array with indexing. Indexing is pos with offset concatenated

Public Methods

Method Description
getDataFileNames ( ) : string[]
getExceptionFileNames ( ) : array Returns array of file names with the exceptions
getExceptionMapFromString ( string $line, string $pos ) : ExceptionMap
getExceptionsMap ( ) : ExceptionMap[] Returns the list of exception spellings
getFileNames ( ) : string[] Returns the list of required files that is provided by the nltk project
getIndexFileNames ( ) : string[]
getLemmaFromString ( string $line ) : Lemma
getLemmas ( ) : Lemma[]
getLexNames ( ) : string[]
getPosFileMaps ( ) : array
getSynsetByOffsetAndPos ( integer $synsetOffset, string $pos ) : Synset Opens the raw data file and reads the synsets in
getSynsetFromString ( string $line ) : Synset Parse the line from the synset file and turn it into a synset object

Method Details

getDataFileNames() public method

public getDataFileNames ( ) : string[]
return string[]

getExceptionFileNames() public method

Returns array of file names with the exceptions
public getExceptionFileNames ( ) : array
return array

getExceptionMapFromString() public method

public getExceptionMapFromString ( string $line, string $pos ) : ExceptionMap
$line string
$pos string
return TextAnalysis\Models\Wordnet\ExceptionMap

getExceptionsMap() public method

Returns the list of exception spellings
public getExceptionsMap ( ) : ExceptionMap[]
return TextAnalysis\Models\Wordnet\ExceptionMap[]

getFileNames() public method

Returns the list of required files that is provided by the nltk project
public getFileNames ( ) : string[]
return string[]

getIndexFileNames() public method

public getIndexFileNames ( ) : string[]
return string[]

getLemmaFromString() public method

public getLemmaFromString ( string $line ) : Lemma
$line string
return TextAnalysis\Models\Wordnet\Lemma

getLemmas() public method

public getLemmas ( ) : Lemma[]
return TextAnalysis\Models\Wordnet\Lemma[] Returns an array of lemmas

getLexNames() public method

public getLexNames ( ) : string[]
return string[]

getPosFileMaps() public method

public getPosFileMaps ( ) : array
return array

getSynsetByOffsetAndPos() public method

Opens the raw data file and reads the synsets in
public getSynsetByOffsetAndPos ( integer $synsetOffset, string $pos ) : Synset
$synsetOffset integer
$pos string Part of speech
return TextAnalysis\Models\Wordnet\Synset

getSynsetFromString() public method

Parse the line from the synset file and turn it into a synset object
public getSynsetFromString ( string $line ) : Synset
$line string
return TextAnalysis\Models\Wordnet\Synset

Property Details

$exceptionsMap protected_oe property

protected ExceptionMap[],TextAnalysis\Models\Wordnet $exceptionsMap
return TextAnalysis\Models\Wordnet\ExceptionMap[]

$lemmas protected_oe property

protected Lemma[],TextAnalysis\Models\Wordnet $lemmas
return TextAnalysis\Models\Wordnet\Lemma[]

$lexNames protected_oe property

stores all the lex names
protected $lexNames

$posFileMaps protected_oe property

map part of speech character to its definition
protected $posFileMaps

$synsets protected_oe property

An array with indexing. Indexing is pos with offset concatenated
protected Synset[],TextAnalysis\Models\Wordnet $synsets
return TextAnalysis\Models\Wordnet\Synset[]