Beispiel #1
0
def test_task():
    _check_corenlp()
    raw = corenlp_lemmatize("It works", output='raw')
    assert_in("<lemma>work</lemma>", raw)  # list of header / sentence / tokens
    saf = corenlp_lemmatize("It works", output='saf')
    assert_equal(len(saf['tokens']), 2)

    raw = corenlp("It works", output='raw')
    assert_in('<dep type="nsubj">', raw)
    saf = corenlp("It works", output='saf')
    assert_equal(len(saf['dependencies']), 1)
Beispiel #2
0
def test_task():
    _check_corenlp()
    raw = corenlp_lemmatize("It works", output='raw')
    assert_equal(len(raw), 3)  # list of header / sentence / tokens
    saf = corenlp_lemmatize("It works", output='saf')
    assert_equal(len(saf['tokens']), 2)

    raw = corenlp("It works", output='raw')
    deps = {'root(ROOT-0, works-2)', 'nsubj(works-2, It-1)', ''}
    assert_equal(set(raw[-3:]), deps)
    saf = corenlp("It works", output='saf')
    assert_equal(len(saf['dependencies']), 1)
Beispiel #3
0
def test_task():
    _check_corenlp()
    raw = corenlp_lemmatize("It works", output='raw')
    assert_equal(len(raw), 3)  # list of header / sentence / tokens
    saf = corenlp_lemmatize("It works", output='saf')
    assert_equal(len(saf['tokens']), 2)

    raw = corenlp("It works", output='raw')
    deps = {'root(ROOT-0, works-2)', 'nsubj(works-2, It-1)', ''}
    assert_equal(set(raw[-3:]), deps)
    saf = corenlp("It works", output='saf')
    assert_equal(len(saf['dependencies']), 1)