def test_epub_stemming(): book = EPUBTranslation("resources/DonQuijote.epub") assert len(book.get_chapter(25).get(10)) == 10
action="store", dest="start", type="int", help="starting point", default=0) (options, args) = parser.parse_args() if options.filename is not None: book = EPUBTranslation(options.filename) if options.chapter is None: print("Imported {0}, please select which chapter to read".format(book.title)) for index, item in enumerate(book.chapters): print("{0}. {1}".format(index, item.get_name())) else: chapter = book.get_chapter(options.chapter) words = [] types = [] if options.verbs is True: types.append("v") elif options.nouns is True: types.append("n") words = chapter.get(options.quantity, start=options.start, types=types, ordered=options.ordered, translate=options.translate, reverse=options.reverse) if options.translate: print_list_to_terminal(words) else: print_untranslated_to_table(words) if __name__ == "__main__":