get_snippets
Retrieve page numbers and context snippets for a query within an ANNO newspaper issue, including matched terms in braces and stable citation URLs.
Instructions
Find which pages of one ANNO issue a query appears on, with context.
This is the cheap triage step and the reason ANNO is worth using: a hit resolves to a page with the matched terms in context, so a false positive can be rejected without downloading anything. It also works for periodicals, whose OCR text cannot be downloaded at all.
Args: identifier: Document id from a search result, e.g. "ANNO_dmo19330626" query: Terms to locate within the issue
Returns: Dictionary containing: - identifier: The document id - query: The query used - snippets: List of occurrences with: - page: Page number the occurrence sits on - page_label: Page label as printed - text: Snippet with matched terms in {braces} - url: Stable citation URL for that exact page - image_url: IIIF crop of the matched region
Note: ANNO returns at most 10 snippets per issue however many hits it reports, so a heavily-covered issue shows a sample rather than every occurrence.
Examples: get_snippets("ANNO_dmo19330626", "Hanussen") get_snippets("ANNO_wsb18840309", "Cumberland")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| identifier | Yes |