Skip to main content

Korp API library for Python

Project description

This library provides an easy way to query Korp systems for language corpora. This library is brought to you by Mika Hämäläinen.

Usage

You can initialise Korp with either service_name (språkbanken, kielipankki or GT) or url to your Korp’s API interface such as https://korp.csc.fi/cgi-bin/korp.cgi .

An example for getting all concordances for North Sami corpora in Giellatekno Korp for query [pos=”A”] “go” [pos=”N”].

from korp import Korp

korppi = Korp(service_name="GT") #uses Giellatekno

corpora = korppi.list_corpora("SME") #lists corpora returns the ones starting with the North Sami language code

number_of_results, concordances = korppi.all_concordances('[pos="A"] "go" [pos="N"]', corpora)

More information

For more information, see the GitHub page and Wiki for tutorials.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

korp-1.0.3.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

korp-1.0.3-py2.py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page