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.

Files for korp, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size korp-1.0.3-py2.py3-none-any.whl (7.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View hashes
Filename, size korp-1.0.3.tar.gz (8.6 kB) File type Source Python version None Upload date Hashes View hashes

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 SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page