Hoppa till huvudinnehåll
Språkbanken Text är en avdelning inom Språkbanken.

Karps webb-API

The Karp web API provides a REST-based web service, allowing access to all lexical resources.

Some examples:

Simple search in all text of all lexical entries for the word elefanten, showing the 25 first words:

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=simple||elefanten

Retrieve the entries of the SALDO morphology containing the wordform elefanten:

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=extended||and|wf|equals|elefanten&resource=saldom

Retrieve all entries in the Dalin dictionary having the wordform räfvar:

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=extended||and|wf|equals|räfvar&resource=dalin

Retrieve all information associated to the sense identifier elefant..1, in all resources:

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=extended||and|sense|equals|elefant..1

The web service allows disjunctive search both on the attributes and the lexicons, e.g., find the information in all resources for the sense identifiers elefant..1 and räv..1:

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=extended||and|sense|equals|elefant..1|räv..1

The web service further allows conjunctive search, e.g., find the information in all resources for the wordform får and part of speech noun:

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=extended||and|wf|equals|får||and|pos|equals|nn

Negated search is also possible, e.g., find all entries in saldo which are not nouns

https://ws.spraakbanken.gu.se/ws/karp/v4/query?q=extended||not|pos|equals|nn&resource=saldo

The web service also has a statistical function, e.g., the number of lexical entries in the resources Saldo and Saldom:

https://ws.spraakbanken.gu.se/ws/karp/v4/statistics?buckets=lexiconName&resource=saldo,saldom

The number of lexical entries grouped by part of speech:

https://ws.spraakbanken.gu.se/ws/karp/v4/statistics?resource=saldo,saldom&buckets=pos.bucket

A random word:

https://ws.spraakbanken.gu.se/ws/karp/v4/random