예제 #1
0
def test_create_two_shingles():
    seq = tokenize(tokenizer, "public void main()")[1:]
    result = get_shingles_str(create_two_shingles(seq))
    estimated_result = {('public', 'void'), ('void', 'main'), ('main', '('), ('(', ')')}
    assert result == estimated_result
    seq = tokenize(tokenizer, "public int main()")[1:]
    result = get_shingles_str(create_two_shingles(seq))
    estimated_result = {('public', 'int'), ('int', 'main'), ('main', '('), ('(', ')')}
    assert result == estimated_result
예제 #2
0
def test_create_two_shingles():
    seq = tokenize(tokenizer, "public void main()")[1:]
    result = get_shingles_str(create_two_shingles(seq))
    estimated_result = {('public', 'void'), ('void', 'main'), ('main', '('),
                        ('(', ')')}
    assert result == estimated_result
    seq = tokenize(tokenizer, "public int main()")[1:]
    result = get_shingles_str(create_two_shingles(seq))
    estimated_result = {('public', 'int'), ('int', 'main'), ('main', '('),
                        ('(', ')')}
    assert result == estimated_result
예제 #3
0
def test_create_two_shingles():
    seq = tokenize(tokenizer, "public void main()")[1:]
    result = create_two_shingles(seq)
    seq = tokenize(tokenizer, "public int main()")[1:]
    result = create_two_shingles(seq)
    assert False == result