コード例 #1
0
ファイル: test_text.py プロジェクト: GordianStapf/pymorph
def test_text_concat():
    o = text('o')
    n = text('n')
    e = text('e')
    assert o.shape == n.shape
    assert o.shape == e.shape
    assert np.all(concat('w', o, n, e,) == text('one'))
    assert np.all(concat('w', o, n, e,) == text('one'))
コード例 #2
0
def test_text_concat():
    o = text('o')
    n = text('n')
    e = text('e')
    assert o.shape == n.shape
    assert o.shape == e.shape
    assert np.all(concat(
        'w',
        o,
        n,
        e,
    ) == text('one'))
    assert np.all(concat(
        'w',
        o,
        n,
        e,
    ) == text('one'))
コード例 #3
0
ファイル: test_text.py プロジェクト: GordianStapf/pymorph
def test_text_len():
    texts = ['o', 'on', 'one', 'one two', 'one two three']
    height = 15
    w_perch = 9
    for t in texts:
        assert text(t).shape == (height,w_perch*len(t))
コード例 #4
0
def test_text_len():
    texts = ['o', 'on', 'one', 'one two', 'one two three']
    height = 15
    w_perch = 9
    for t in texts:
        assert text(t).shape == (height, w_perch * len(t))