Пример #1
0
def test_xpos_attribute():
    response = semgrex.process_doc(
        ONE_SENTENCE_DOC, "{tag:NNP}=source <=zzz {word:Opal}=target")
    check_response(response, response_len=1, source_index=2, reln='compound')
    response = semgrex.process_doc(
        ONE_SENTENCE_DOC, "{pos:NNP}=source <=zzz {word:Opal}=target")
    check_response(response, response_len=1, source_index=2, reln='compound')
Пример #2
0
def test_ner_attribute():
    doc = Document(TEST_ONE_SENTENCE)
    response = semgrex.process_doc(
        doc, "{cpos:PROPN}=source <=zzz {ner:GEM}=target")
    check_response(response, response_len=1, source_index=2, reln='compound')
Пример #3
0
def test_lemma_attribute():
    doc = Document(TEST_ONE_SENTENCE)
    response = semgrex.process_doc(
        doc, "{lemma:Mox}=source <=zzz {lemma:Opal}=target")
    check_response(response, response_len=1, source_index=2, reln='compound')
Пример #4
0
def test_two_sentences():
    doc = Document(TEST_TWO_SENTENCES)
    response = semgrex.process_doc(doc, "{}=source >obj=zzz {}=target")
    check_response(response, response_len=2)
Пример #5
0
def test_two_semgrex():
    doc = Document(TEST_ONE_SENTENCE)
    response = semgrex.process_doc(doc, "{}=source >obj=zzz {}=target",
                                   "{}=source >obj=zzz {}=target")
    check_response(response, semgrex_len=2)
Пример #6
0
def test_single_sentence():
    doc = Document(TEST_ONE_SENTENCE)
    response = semgrex.process_doc(doc, "{}=source >obj=zzz {}=target")
    check_response(response)
Пример #7
0
def test_lemma_attribute():
    response = semgrex.process_doc(
        ONE_SENTENCE_DOC, "{lemma:Mox}=source <=zzz {lemma:Opal}=target")
    check_response(response, response_len=1, source_index=2, reln='compound')
Пример #8
0
def test_two_sentences():
    response = semgrex.process_doc(TWO_SENTENCE_DOC,
                                   "{}=source >obj=zzz {}=target")
    check_response(response, response_len=2)
Пример #9
0
def test_two_semgrex():
    response = semgrex.process_doc(ONE_SENTENCE_DOC,
                                   "{}=source >obj=zzz {}=target",
                                   "{}=source >obj=zzz {}=target")
    check_response(response, semgrex_len=2)
Пример #10
0
def test_single_sentence():
    response = semgrex.process_doc(ONE_SENTENCE_DOC,
                                   "{}=source >obj=zzz {}=target")
    check_response(response)