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.