PHP 클래스 TextAnalysis\Indexes\InvertedIndex

저자: yooper (yooper)
파일 보기 프로젝트 열기: yooper/php-text-analysis 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$index array The index

공개 메소드들

메소드 설명
__construct ( TextAnalysis\Interfaces\IDataReader $reader ) Pass in the pre-built indexes for doing lookups
__destruct ( ) clean up
addDocument ( TokensDocument $document ) : void Add a document
getDocumentIdsByTerm ( string $term ) : array
getIndex ( ) : array Return the internal index data structure
getTermsByDocumentId ( mixed $docId ) : array Returns the key value array with the terms found in the document for the given doc id
query ( string $queryStr ) : array Accepts a string a query and returns the set of documents relevant to the query
removeDocument ( mixed $docId ) : boolean True if the doc was removed

메소드 상세

__construct() 공개 메소드

Pass in the pre-built indexes for doing lookups
public __construct ( TextAnalysis\Interfaces\IDataReader $reader )
$reader TextAnalysis\Interfaces\IDataReader

__destruct() 공개 메소드

clean up
public __destruct ( )

addDocument() 공개 메소드

Add a document
public addDocument ( TokensDocument $document ) : void
$document TextAnalysis\Documents\TokensDocument
리턴 void

getDocumentIdsByTerm() 공개 메소드

public getDocumentIdsByTerm ( string $term ) : array
$term string
리턴 array

getIndex() 공개 메소드

Return the internal index data structure
public getIndex ( ) : array
리턴 array

getTermsByDocumentId() 공개 메소드

Returns the key value array with the terms found in the document for the given doc id
public getTermsByDocumentId ( mixed $docId ) : array
$docId mixed
리턴 array

query() 공개 메소드

Accepts a string a query and returns the set of documents relevant to the query
public query ( string $queryStr ) : array
$queryStr string
리턴 array

removeDocument() 공개 메소드

True if the doc was removed
public removeDocument ( mixed $docId ) : boolean
$docId mixed
리턴 boolean

프로퍼티 상세

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

The index
protected array $index
리턴 array