PHP Class TextAnalysis\Downloaders\DownloadPackageFactory

Author: yooper
Mostrar archivo Open project: yooper/php-text-analysis Class Usage Examples

Protected Properties

Property Type Description
$package TextAnalysis\Utilities\Nltk\Download\Package

Public Methods

Method Description
download ( Package $package ) : DownloadPackageFactory Initializes and downloads the remote corpus
getDownloadFullPath ( ) : string Has the full path to where the download should go
getInstallDir ( ) : string The path where the software should be installed
getPackage ( ) : Package
initialize ( ) Initialize the directories required for the download
verifyChecksum ( ) : boolean Verify the packages checksum against the downloaded file

Protected Methods

Method Description
__construct ( Package $package ) Installs the package
downloadRemoteFile ( )
extractZip ( $srcPath, $extractToDir ) Use PHP's ZipArchive to extract out the data
isZip ( string $path ) : boolean
recursiveCopy ( string $src, string $dst ) Recursive copy the directory
unpackPackage ( ) de-compress the downloaded corpus into the install directory, or copy the files into the install directory

Method Details

__construct() protected method

Installs the package
protected __construct ( Package $package )
$package TextAnalysis\Utilities\Nltk\Download\Package

download() public static method

Initializes and downloads the remote corpus
public static download ( Package $package ) : DownloadPackageFactory
$package TextAnalysis\Utilities\Nltk\Download\Package
return DownloadPackageFactory

downloadRemoteFile() protected method

protected downloadRemoteFile ( )

extractZip() protected method

Use PHP's ZipArchive to extract out the data
protected extractZip ( $srcPath, $extractToDir )

getDownloadFullPath() public method

Has the full path to where the download should go
public getDownloadFullPath ( ) : string
return string

getInstallDir() public method

The path where the software should be installed
public getInstallDir ( ) : string
return string

getPackage() public method

public getPackage ( ) : Package
return TextAnalysis\Utilities\Nltk\Download\Package

initialize() public method

Initialize the directories required for the download
public initialize ( )

isZip() protected method

protected isZip ( string $path ) : boolean
$path string
return boolean

recursiveCopy() protected method

Recursive copy the directory
protected recursiveCopy ( string $src, string $dst )
$src string
$dst string

unpackPackage() protected method

de-compress the downloaded corpus into the install directory, or copy the files into the install directory
protected unpackPackage ( )

verifyChecksum() public method

Verify the packages checksum against the downloaded file
public verifyChecksum ( ) : boolean
return boolean

Property Details

$package protected_oe property

protected Package,TextAnalysis\Utilities\Nltk\Download $package
return TextAnalysis\Utilities\Nltk\Download\Package