Exemple #1
0
def test_query_satt(germaparl):

    corpus = Corpus(germaparl['corpus_name'],
                    registry_path=germaparl['registry_path'])
    dump = corpus.query_s_att('p_type', {'interjection'})
    conc = dump.concordance(form='simple')
    print(conc)
Exemple #2
0
def test_query_satt_easy(brexit):

    corpus = Corpus(brexit['corpus_name'],
                    registry_path=brexit['registry_path'])
    dump = corpus.query_s_att('np')
    conc = dump.concordance(form='simple')
    print(conc)
Exemple #3
0
dump.correct_anchors({3: +1, 4: -1})
lines = dump.concordance(form='slots', slots={"name": [1, 2], "party": [3, 4]})
copymd(lines)

# COLLOCATES
dump = corpus.query('[lemma="SPD"]', context=10, context_break='s')

collocates = dump.collocates()
copymd(collocates)

collocates = dump.collocates(['lemma', 'pos'], order='log_likelihood')
copymd(collocates)

# SUBCORPORA
dump = corpus.query('"SPD" expand to s')
dump = corpus.query_s_att("s")
# dump = corpus.query_s_att("np")
copymd(corpus.query('[lemma="sagen"]').breakdown(), cut_off=None)
corpus.query_s_att("text_party", values={"CDU", "CSU"}, name="Union")
corpus.activate_subcorpus("Union")
copymd(corpus.query('[lemma="sagen"]').breakdown(), cut_off=None)
corpus.activate_subcorpus()
print(corpus.subcorpus)

copymd(corpus.show_nqr())

# KEYWORDS
dump = corpus.query_s_att("text_party", values={"CDU", "CSU"}, name="Union")
copymd(dump.keywords(order="log_likelihood"))

copymd(dump.keywords(['lemma', 'pos'], order="log_likelihood"))