home << dhlab reference << dhlab.api.dhlab_api

concordance#

from dhlab.api.dhlab_api import concordance
concordance(urns=None, words=None, window=25, limit=100)[source]#

Get a list of concordances from the National Library’s database.

Call the API BASE_URL endpoint /conc.

Parameters:
  • urns (list) – uniform resource names, for example: ["URN:NBN:no-nb_digibok_2008051404065", "URN:NBN:no-nb_digibok_2010092120011"]

  • words (str) – Word(s) to search for. Can be an SQLite fulltext query, an fts5 string search expression.

  • window (int) – number of tokens on either side to show in the collocations, between 1-25.

  • limit (int) – max. number of concordances per document. Maximum value is 1000.

Returns:

a table of concordances

Return type:

DataFrame