示例#1
0
def test_compute_edge_ngrams_honor_min_edge_ngrams_setting(config):
    config.MIN_EDGE_NGRAMS = 1
    assert compute_edge_ngrams('abcd') == ['a', 'ab', 'abc']
示例#2
0
def test_compute_edge_ngrams():
    assert compute_edge_ngrams('vanbrechi') == [
        'van', 'vanb', 'vanbr', 'vanbre', 'vanbrec', 'vanbrech'
    ]
示例#3
0
def test_compute_edge_ngrams_honor_max_edge_ngrams_setting(config):
    config.MAX_EDGE_NGRAMS = 5
    assert compute_edge_ngrams('abcdefghijklmn') == ['abc', 'abcd', 'abcde']
示例#4
0
def test_compute_edge_ngrams_honor_max_edge_ngrams_setting(config):
    config.MAX_EDGE_NGRAMS = 5
    assert compute_edge_ngrams('abcdefghijklmn') == ['abc', 'abcd', 'abcde']
示例#5
0
def test_compute_edge_ngrams_honor_min_edge_ngrams_setting(config):
    config.MIN_EDGE_NGRAMS = 1
    assert compute_edge_ngrams('abcd') == ['a', 'ab', 'abc']
示例#6
0
def test_compute_edge_ngrams():
    assert compute_edge_ngrams('vanbrechi') == [
        'van', 'vanb', 'vanbr', 'vanbre', 'vanbrec', 'vanbrech'
    ]