'Apply the pipeline to some text.  The text can span multiple sentences,
and can contain arbtrary whitespace.  Alignment into the original string
is preserved.
Argsuments:
text (unicode): The text to be processed.
Returns:
doc (Doc): A container for accessing the annotations.
Example:
>>> from spacy.en import English
>>> nlp = English()
>>> tokens = nlp(\'An example sentence. Another example sentence.\')
>>> tokens[0].orth_, tokens[0].head.tag_
(\'An\', \'NN\')'

def __call__(self, text, tag=True, parse=True, entity=True):

    doc = self.make_doc(text)
    if (self.entity and entity):
        for token in doc:
            if (token.ent_type != 0):
                self.entity.add_label(token.ent_type)
    skip = {self.tagger: (not tag), self.parser: (not parse), self.entity: (not entity)}
    for proc in self.pipeline:
        if (proc and (not skip.get(proc))):
            proc(doc)
    return doc
