NlpTools API
Class

NlpTools\Documents\TrainingDocument

class TrainingDocument implements DocumentInterface

A TrainingDocument is a document that "decorates" any other document to add the real class of the document.

It is used while training
together with the training set.

Methods

__construct(string $class, DocumentInterface $d)

mixed getDocumentData()

Return the data of what is being represented.

getClass()

applyTransformation(TransformationInterface $transform)

Pass the transformation to the decorated document

Details

at line 21
public __construct(string $class, DocumentInterface $d)

Parameters

string $class The actual class of the Document $d
DocumentInterface $d The document to be decorated

at line 26
public mixed getDocumentData()

Return the data of what is being represented.

If it were a word
we could return a word. If it were a blog post we could return
an array(Title,Body,array(Comments)).

Return Value

mixed

at line 30
public getClass()

at line 40
public applyTransformation(TransformationInterface $transform)

Pass the transformation to the decorated document

Parameters

TransformationInterface $transform The transformation to be applied