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.

Filename, size & hash SHA256 hash help File type Python version Upload date
korp-1.0.2-py2.py3-none-any.whl (6.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Oct 26, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page