Exemplo n.º 1
0
def test31():
    shingles = ks.shingleseqs_list("", [1])
    assert shingles == [[]]

    shingles = ks.shingleseqs_list(" ", [1])
    assert shingles == [[" "]]

    shingles = ks.shingleseqs_list(" ", [1, 2])
    assert shingles == [[" "], []]
Exemplo n.º 2
0
def test52():
    seqs = ks.shingleseqs_list("12345",
                               klist=[2, 5],
                               padding='post',
                               placeholder='x')
    target = [['12', '23', '34', '45', 'x'], ['12345', 'x', 'x', 'x', 'x']]
    assert seqs == target
Exemplo n.º 3
0
def test49():
    seqs = ks.shingleseqs_list("12345",
                               klist=[2, 5],
                               padding='center',
                               placeholder='x',
                               evenpad='pre')
    target = [['x', '12', '23', '34', '45'], ['x', 'x', '12345', 'x', 'x']]
    assert seqs == target
Exemplo n.º 4
0
def test33():
    shingles = ks.shingleseqs_list("12345", [5, 6])
    assert shingles == [['12345'], []]

    shingles = ks.shingleseqs_list("12345", [0, 3, 6])
    assert shingles == [['123', '234', '345'], []]  # this is a problem!
Exemplo n.º 5
0
def test32():
    shingles = ks.shingleseqs_list(" ", [0])
    assert shingles == []

    shingles = ks.shingleseqs_list(" ", [-1])
    assert shingles == []