def test___bag_of_words(string, length, total, parser):
    bow = tkn.bag_of_words(parser, string)
    assert (len(bow) == length)
    assert (sum_tally_tuples(bow) == total)
def test__bag_of_words(wordcounts, exbow, exdict):
    bow, dict_ = tkn.bag_of_words(wordcounts)
    assert(bow == exbow)
    assert(dict_ == exdict)
Esempio n. 3
0
def test__bag_of_words(wordcounts, exbow, exdict):
    bow, dict_ = tkn.bag_of_words(wordcounts)
    assert (bow == exbow)
    assert (dict_ == exdict)
def test___bag_of_words(string, length, total, parser):
    bow = tkn.bag_of_words(parser, string)
    assert(len(bow) == length)
    assert(sum_tally_tuples(bow) == total)