Skip to main content

Addresses

An address is a validated string:
It is a string, not a class, because exchange formats require URI strings and addresses are used as keys. The validator gives every address one canonical form (Unicode NFC, percent-encoding, lower-case scheme), so an address always compares equal to itself. A Document has the address <document scheme>://<scope>/<unit>. Each passage has <scheme>://<scope>/<unit>#<anchor>.

Ids

A concept’s path (/{scope}/{context path}/{slug}) is its id in an exported bundle. The path changes when the concept moves. The id does not.

Three normal forms

Each form has one job.

Fingerprints

A fingerprint is a hash of a faithful span of text. passage_fingerprint(raw) hashes the whole faithful passage. Fingerprints let the index find a span again after the source moves it, without storing the span. locate(passage, fingerprint, length, hint_start=...) returns the new start, or None when the words are gone. Lesson 1 shows this with a passage whose text shifts, and with a rule that is edited so the evidence goes stale.

Data model

The records that carry these ids and addresses.