PHP 클래스 TextAnalysis\Documents\TokensDocument

저자: yooper (yooper)
상속: extends TextAnalysis\Documents\DocumentAbstract
파일 보기 프로젝트 열기: yooper/php-text-analysis 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$counter
$createdOn time doc was created defaults to now
$id mixed
$metadata array Stores an array of metadata about the document
$tokens type An array of tokens that all Documents have

공개 메소드들

메소드 설명
__construct ( array $tokens, mixed $id = null, DateTim\DateTime $createdOn = null, array $metadata = [] )
applyExtract ( TextAnalysis\Interfaces\IExtractStrategy $extract ) : array Apply an extract filter and return the results after filter all the documents in the collection
applyStemmer ( TextAnalysis\Interfaces\IStemmer $stemmer, boolean $removeNulls = true ) : TokensDocument Apply a stemmer
applyTransformation ( TextAnalysis\Interfaces\ITokenTransformation $transformer, $removeNulls = true ) : TokensDocument Apply the transformation
getCreatedOn ( ) : DateTim\DateTime
getDocumentData ( ) : array Return an array of tokens
getId ( ) : mixed
getMetadata ( ) : array
setCreatedOn ( DateTim\DateTime $createdOn ) : TokensDocument
setMetadata ( array $metadata ) : TokensDocument
toArray ( ) : array Return the tokens

메소드 상세

__construct() 공개 메소드

public __construct ( array $tokens, mixed $id = null, DateTim\DateTime $createdOn = null, array $metadata = [] )
$tokens array
$id mixed
$createdOn DateTim\DateTime
$metadata array

applyExtract() 공개 메소드

Apply an extract filter and return the results after filter all the documents in the collection
public applyExtract ( TextAnalysis\Interfaces\IExtractStrategy $extract ) : array
$extract TextAnalysis\Interfaces\IExtractStrategy
리턴 array

applyStemmer() 공개 메소드

Apply a stemmer
public applyStemmer ( TextAnalysis\Interfaces\IStemmer $stemmer, boolean $removeNulls = true ) : TokensDocument
$stemmer TextAnalysis\Interfaces\IStemmer
$removeNulls boolean
리턴 TokensDocument

applyTransformation() 공개 메소드

Apply the transformation
public applyTransformation ( TextAnalysis\Interfaces\ITokenTransformation $transformer, $removeNulls = true ) : TokensDocument
$transformer TextAnalysis\Interfaces\ITokenTransformation
리턴 TokensDocument

getCreatedOn() 공개 메소드

public getCreatedOn ( ) : DateTim\DateTime
리턴 DateTim\DateTime

getDocumentData() 공개 메소드

Return an array of tokens
public getDocumentData ( ) : array
리턴 array

getId() 공개 메소드

public getId ( ) : mixed
리턴 mixed

getMetadata() 공개 메소드

public getMetadata ( ) : array
리턴 array

setCreatedOn() 공개 메소드

public setCreatedOn ( DateTim\DateTime $createdOn ) : TokensDocument
$createdOn DateTim\DateTime
리턴 TokensDocument

setMetadata() 공개 메소드

public setMetadata ( array $metadata ) : TokensDocument
$metadata array
리턴 TokensDocument

toArray() 공개 메소드

Return the tokens
public toArray ( ) : array
리턴 array

프로퍼티 상세

$counter 보호되어 있는 정적으로 프로퍼티

protected static $counter

$createdOn 보호되어 있는 프로퍼티

time doc was created defaults to now
protected $createdOn

$id 보호되어 있는 프로퍼티

protected mixed $id
리턴 mixed

$metadata 보호되어 있는 프로퍼티

Stores an array of metadata about the document
protected array $metadata
리턴 array

$tokens 보호되어 있는 프로퍼티

An array of tokens that all Documents have
protected type $tokens
리턴 type