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')
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')
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')
def test_two_sentences(): doc = Document(TEST_TWO_SENTENCES) response = semgrex.process_doc(doc, "{}=source >obj=zzz {}=target") check_response(response, response_len=2)
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)
def test_single_sentence(): doc = Document(TEST_ONE_SENTENCE) response = semgrex.process_doc(doc, "{}=source >obj=zzz {}=target") check_response(response)
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')
def test_two_sentences(): response = semgrex.process_doc(TWO_SENTENCE_DOC, "{}=source >obj=zzz {}=target") check_response(response, response_len=2)
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)
def test_single_sentence(): response = semgrex.process_doc(ONE_SENTENCE_DOC, "{}=source >obj=zzz {}=target") check_response(response)