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

word_concordance#

from dhlab.api.dhlab_api import word_concordance
word_concordance(urn=None, dhlabid=None, words=None, before=12, after=12, limit=100, samplesize=50000)[source]#

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

Call the API BASE_URL endpoint /conc.

Parameters:
  • urns (list) – dhlab serial ids. (server can take both urns and dhlabid but so we may rewrite this to)

  • words (str) – Word(s) to search for – must be a list

  • before (int) – between 0-24.

  • after (int) – between 0-24 (before + sum <= 24)

  • limit (int) – max. number of concordances per server process.

  • samplesize (int) – samples from urns.

Returns:

a table of concordances

Return type:

DataFrame