def _get_sentence_tokenizer(self, language): try: path = to_string("tokenizers/punkt/%s.pickle") % to_string( language) return nltk.data.load(path) except (LookupError, zipfile.BadZipfile): raise LookupError( "NLTK tokenizers are missing. Download them by following command: " '''python -c "import nltk; nltk.download('punkt')"''')
def __repr__(self): return to_string("<%s: %s>") % ("Heading" if self._is_heading else "Sentence", self.__str__())
def expand_resource_path(path): directory = dirname(sys.modules["sumy"].__file__) directory = abspath(directory) return join(directory, to_string("data"), to_string(path))
def __repr__(self): return to_string("<ItemsCount: %r>" % self._value)