Source code for fonduer.parser.lingual_parser.lingual_parser

from typing import Collection, Iterable, Iterator

from fonduer.parser.models import Sentence

[docs]class LingualParser(object): """Lingual parser."""
[docs] def split_sentences(self, text: str) -> Iterable[dict]: """ Split input text into sentences. :param text: text to be split :return: A generator of dict that is used as `**kwargs` to instantiate :class:`Sentence <fonduer.parser.models.Sentence>`. """ raise NotImplementedError()
[docs] def enrich_sentences_with_NLP( self, sentences: Collection[Sentence] ) -> Iterator[Sentence]: """ Add NLP attributes like lemmas, pos_tags, etc. to sentences. :param sentences: a iterator of :class:`Sentence <fonduer.parser.models.Sentence>`. :return: a generator of :class:`Sentence <fonduer.parser.models.Sentence>`. """ raise NotImplementedError()
[docs] def has_NLP_support(self) -> bool: """ Returns True when NLP is supported. :return: True when NLP is supported. """ raise NotImplementedError()
[docs] def has_tokenizer_support(self) -> bool: """ Returns True when a tokenizer is supported. :return: True when a tokenizer is supported. """ raise NotImplementedError()