Esempio n. 1
0
def extract_authors_test():
    authors, title = Preprocessor.extract_authors(u"Старый Хелом")
    assert not authors
    authors, title = Preprocessor.extract_authors(u"О Шекспире")
    assert not authors
    authors, title = Preprocessor.extract_authors(u"Кристофер Сташефф, Уильям Р.Форстчен. Расплата")
    #print authors,title
    pass
Esempio n. 2
0
def cleanup_kilobytes_test():
    assert u"Book  yeah!" == Preprocessor.cleanup_kilobytes(u"Book (19 k) yeah!")
    pass
Esempio n. 3
0
def cleanup_numeration_test():
    titles = ['1. Василий Теркин', '2. Теркин на том свете', '62. Модель для сборки', '35.Проклятие вождя','Причесывая Жирафу.. Глава 1.']
    r_titles = ['Василий Теркин', 'Теркин на том свете', 'Модель для сборки', 'Проклятие вождя','Причесывая Жирафу.. Глава 1.']
    for title, r_title in zip(titles, r_titles):
        title = Preprocessor.cleanup_numeration(title)
        assert title == r_title
Esempio n. 4
0
def is_author_test():
    assert Preprocessor.is_author(u"Старый Хелом") == True
    pass
Esempio n. 5
0
def cleanup_year_test():
    assert u"Book  yeah!" == Preprocessor.cleanup_year(u"Book (1990) yeah!")
    assert u"Book  yeah!" == Preprocessor.cleanup_year(u"Book [1990] yeah!")