PHP Class TextAnalysis\Taggers\StanfordAbstract

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

Protected Properties

Property Type Description
$classifierPath Path to the classifier you want to use
$errors Errors from proc_open
$jarPath string Path to the stanford NER jar
$javaOptions options passed the java vm
$output Output from proc_open
$separator string The separators between tokens
$tmpFilePath string Place for storing the tokenized words to

Public Methods

Method Description
__construct ( string $jarPath, string $classifierPath, string $javaOptions = ['-mx700m'], $separator = '/' )
__destruct ( )
getClassifierPath ( ) : string Returns the path to the classifier
getCommand ( ) : string
getJarPath ( ) : string Returns the path to the ner jar
getJavaOptions ( ) : array
getPathToJava ( ) : string
getSeparator ( ) : string Separator used between tokens
getTmpFilePath ( ) : string
tag ( array $tokens )

Protected Methods

Method Description
exec ( ) Calls the stanford jar file
getParsedOutput ( ) : array Requires that class output var be populated. Punctuation may cause issues
getPathSeparator ( ) : string
verify ( ) verifies required files exist

Method Details

__construct() public method

public __construct ( string $jarPath, string $classifierPath, string $javaOptions = ['-mx700m'], $separator = '/' )
$jarPath string
$classifierPath string
$javaOptions string

__destruct() public method

public __destruct ( )

exec() protected method

Calls the stanford jar file
protected exec ( )

getClassifierPath() public method

Returns the path to the classifier
public getClassifierPath ( ) : string
return string

getCommand() abstract public method

abstract public getCommand ( ) : string
return string Returns the cli that is passed to proc_open

getJarPath() public method

Returns the path to the ner jar
public getJarPath ( ) : string
return string

getJavaOptions() public method

public getJavaOptions ( ) : array
return array

getParsedOutput() abstract protected method

Requires that class output var be populated. Punctuation may cause issues
abstract protected getParsedOutput ( ) : array
return array

getPathSeparator() protected method

protected getPathSeparator ( ) : string
return string Return based on the OS used

getPathToJava() public method

public getPathToJava ( ) : string
return string

getSeparator() public method

Separator used between tokens
public getSeparator ( ) : string
return string default is /

getTmpFilePath() public method

public getTmpFilePath ( ) : string
return string

tag() public method

public tag ( array $tokens )
$tokens array Use a tokenizer

verify() protected method

verifies required files exist
protected verify ( )

Property Details

$classifierPath protected_oe property

Path to the classifier you want to use
protected $classifierPath

$errors protected_oe property

Errors from proc_open
protected $errors

$jarPath protected_oe property

Path to the stanford NER jar
protected string $jarPath
return string

$javaOptions protected_oe property

options passed the java vm
protected $javaOptions

$output protected_oe property

Output from proc_open
protected $output

$separator protected_oe property

The separators between tokens
protected string $separator
return string

$tmpFilePath protected_oe property

Place for storing the tokenized words to
protected string $tmpFilePath
return string