# Sources of the masking country packs

Each country folder holds four lists, one lower-cased word per line, sorted:

- `names.txt`: first names and surnames from the country's official name statistics;
- `common-words.txt`: the 5,000 most frequent words of the country's language;
- `context-words.txt`: words such as "mamma" or "saksbehandler" after which a capitalised word is
  taken as a name. A compound ending in one of six letters or more ("klasslärare") counts as one too.
  Written by hand.
- `not-names.txt`: small words such as "om", "när" or "sida" that a name list holds (every pack runs
  on every document, so a Danish name list reaches Swedish text) but that are never a person's name
  in a document. Only words that are no realistic first name or surname: "inga", "klara" or "sol"
  stay off it. Written by hand.

`names.txt` and `common-words.txt` are written by `scripts/masking/build-name-lists.mjs` and never
edited by hand. Every name entry is split at spaces and hyphens ("Anna-Karin", "Al Sayed"), and parts
of one letter or with a digit are dropped. Re-running the script on unchanged sources reproduces the
files byte for byte. When a source is refreshed, re-run it and update the date below. Why these are
files and not Firestore records: ADR-0102.

## Sweden (`se`)

- **Names:** Statistics Sweden (SCB), "Statistik över namn efter födelseland 2020", published by the
  Swedish National Data Service (SND), https://doi.org/10.5878/fc4h-rp11, file
  `Statistik över namn efter födelseland 2020.zip` (`men_wide.csv`, `women_wide.csv`,
  `lastname_wide.csv`). Licence: CC BY 4.0, https://creativecommons.org/licenses/by/4.0/. Filter:
  names with 5 or more bearers in total. Downloaded 2026-10-20. 206,874 words.
- **Common words:** hermitdave/FrequencyWords, `content/2018/sv/sv_50k.txt` at commit
  `525f9b560de45753a5ea01069454e72e9aa541c6`, https://github.com/hermitdave/FrequencyWords, first
  5,000 lines. Content licence: CC BY-SA 4.0, https://creativecommons.org/licenses/by-sa/4.0/.
  Downloaded 2026-10-20.

## Norway (`no`)

- **Names:** Statistics Norway (SSB), StatBank table 10501 (first names) and table 12891 (surnames),
  https://data.ssb.no/api/v0/no/table/10501 and https://data.ssb.no/api/v0/no/table/12891, every
  value text the table lists. SSB publishes only names with at least 200 bearers. Licence: CC BY 4.0,
  https://www.ssb.no/en/diverse/lisens. Downloaded 2026-10-20. 5,697 words.
- **Common words:** hermitdave/FrequencyWords, `content/2018/no/no_50k.txt`, same commit, first 5,000
  lines. Content licence: CC BY-SA 4.0. Downloaded 2026-10-20.

## Denmark (`dk`)

- **Names:** Statistics Denmark (Danmarks Statistik), "Navne registreret i Danmark 2020", published by
  Digitaliseringsstyrelsen,
  https://sprogtek-ressources.digst.govcloud.dk/danmarks%20statistik/navne_registreret_i_danmark_2020.zip
  (`Fornavne - kvinder - alle.txt`, `Fornavne - mænd - alle.txt`, `Efternavne - alle.txt`): every
  registered name, no counts. Licence: CC BY 4.0, with Danmarks Statistik named as the source.
  Downloaded 2026-10-20. 338,571 words.
- **Common words:** hermitdave/FrequencyWords, `content/2018/da/da_50k.txt`, same commit, first 5,000
  lines. Content licence: CC BY-SA 4.0. Downloaded 2026-10-20.

## Terms

The name lists are CC BY 4.0: passing them on requires naming the source as above. The common-word
lists are CC BY-SA 4.0: the share-alike term covers those `common-words.txt` files, not the code that
reads them.

# Text recognition

Scanned pages are read on your machine by tesseract.js (https://github.com/naptha/tesseract.js), the
Tesseract recognition engine compiled to WebAssembly, run in Node's worker threads. Its code is
bundled into `dist/recognition/` with what it uses, each under its own terms:

- tesseract.js 7.0.0: Apache License 2.0, `dist/recognition/licences/tesseract.js-LICENSE.md`.
- tesseract.js-core 7.0.0: Apache License 2.0, `dist/recognition/licences/tesseract.js-core-LICENSE`.
- wasm-feature-detect 1.9.0: Apache License 2.0, `dist/recognition/licences/wasm-feature-detect-LICENSE`.
- regenerator-runtime 0.13.11: MIT License, `dist/recognition/licences/regenerator-runtime-LICENSE`.
- bmp-js 0.1.0: MIT License, `dist/recognition/licences/bmp-js-LICENSE`.
- is-url 1.2.4: MIT License, `dist/recognition/licences/is-url-LICENSE-MIT`.

The language data is tessdata_fast (https://github.com/tesseract-ocr/tessdata_fast) for Swedish,
Danish, Norwegian and English, under the Apache License 2.0 in
`dist/recognition/tessdata/tessdata_fast-LICENSE.txt`.
