Beispiel #1
0
def test_shape(token, expected):
    features = FeaturePreprocessor.shape(token)
    assert features[0] == expected
    assert len(features) == 1
Beispiel #2
0
def test_suffix3():
    assert ["S3k"] == FeaturePreprocessor.suffix3('kot')
Beispiel #3
0
def test_qubliki():
    assert [] == FeaturePreprocessor.qubliki('kot')
    assert ['ale'] == FeaturePreprocessor.qubliki('ale')
    assert ['ale'] == FeaturePreprocessor.qubliki('Ale')
Beispiel #4
0
def test_suffix1():
    assert ["S1t"] == FeaturePreprocessor.suffix1('kot')
    assert ["S1??"] == FeaturePreprocessor.suffix1('kot©')
Beispiel #5
0
def test_suffix2():
    assert ["S2o"] == FeaturePreprocessor.suffix2('kot')
    assert ["S2xx"] == FeaturePreprocessor.suffix2('k')
Beispiel #6
0
def test_prefix3():
    assert ["P2t"] == FeaturePreprocessor.prefix3('kot')
Beispiel #7
0
def test_prefix2():
    assert ["P1o"] == FeaturePreprocessor.prefix2('kot')
    assert ["P1xx"] == FeaturePreprocessor.prefix2('k')
Beispiel #8
0
def test_prefix1():
    assert ["P0k"] == FeaturePreprocessor.prefix1('kot')
    assert ["P0??"] == FeaturePreprocessor.prefix1('©kot')
    assert ["P0k"] == FeaturePreprocessor.prefix1('KOT')
Beispiel #9
0
def test_interps():
    assert ["."] == FeaturePreprocessor.interps('.', {'tags': ['interp']})
    assert [] == FeaturePreprocessor.interps('.', {'tags': ['subst']})
    assert [] == FeaturePreprocessor.interps(':)', {'tags': ['interp']})
Beispiel #10
0
def test_nic(token):
    assert ["NIC"] == FeaturePreprocessor.nic(token)