How the tools work

The methods behind the tools of the PHI Greek Inscriptions server: what each tool counts, in which order, and where it stops. The numbers on this page come from the server's code, so they are the ones it uses now.

Tools: the data under all tools · search_inscriptions · find_parallels · the lookup tools

The data under all tools

Every tool reads the same texts: the PHI corpus of Greek inscriptions, in betacode, as the printed editions give them. Betacode writes Greek in Latin letters: DHMOS is δημος.

The search text

For search and parallels, the server keeps one long string of letters for the whole corpus, made once from the texts.

Status of a letterIn the editionon_stonefullrestored
Read on the stoneαyesyesno
Uncertain readingạyesyesno
Erased in antiquity, still legible⟦α⟧yesyesno
Restored by the editor[α]noyesyes
Abbreviation written out(α)noyesyes
Letter the cutter left out, added by the editor⟨α⟩noyesyes
Lost: the place is known, the letter is not[.]nonono

The editor's notes inside the text are a fourth layer, apparatus, and no other layer reads them.

Dates

The corpus gives dates as text (“2nd/3rd c. AD”, “Hellenistic period”, “287-281 BC”). The server holds each date as a range of years, with years BC as negative numbers: “2nd/3rd c. AD” is AD 101 to 300, and “Hellenistic period” is 323 to 31 BC. A table made once for the whole corpus gives the range of each date text. A text with no date, or with only one end, has no range.

A split year gives the era when the date text does not. A year that counts down (345/4) is BC, because years BC grow smaller; a year that counts up (170/1) is AD.

Places

Each text has a region, a subregion and a site. The old database spelled some sites in more than one way (“Samos Isl.”, “Ath.”, “Antiochia”). A table of 362 spellings joins each to one name (Samos, Athens, Antiocheia), in the Greek form the corpus uses: k for c, -eia for -ia. The site filter uses these names; list_regions gives them.

Finds where a string of letters stands, and counts the inscriptions with a match by region, publication, century and word.

The query

  1. The server reads the query as Greek. Unicode Greek is turned into betacode. Latin letters are read as betacode, never as English: demos is δεμος, not δῆμος. Brackets in the query do not count, and accents and breathings count only with accents="match" (below).
  2. | separates alternatives (λαβ|ληψ|λαμβαν). A query may have at most 24, and a match of any one is a match.
  3. . is one unknown letter. A query may have at most 8, all its alternatives together.
  4. With script="latin", the query is read as Latin and folded like the Latin passages. With script="both", the server looks for the Greek reading and the Latin reading.

The scan

  1. The server joins the alternatives into one state machine and reads the search text once, start to end. A match never runs from one inscription into the next.
  2. Layer. A match counts only if the layer reads each letter it covers. With on_stone, a match that needs one restored letter does not count. The default is full.
  3. Place in the word (match_at). The default is anywhere, because many texts have no word division. word_start needs a word division, or the start of the text, before the match; word_end needs one after it; whole_word needs both. A lost or barred letter next to the match also counts as the edge of a word, because the rest of the word is not there to read.
  4. Filters (region, site, publication, date, note) choose the inscriptions first. The scan reads only those.
  5. The scan stops at 300,000 matches. The answer then says “more than”, and all counts cover only the matches found before that point. They lean toward the publications that come first in the corpus.

Accents (accents)

By default the search ignores accents and breathings. With accents="match" it reads them, by the rule of the old PHI site:

  1. The scan finds the letters as usual.
  2. For each match, the server reads the marks on each letter in the text: breathings, accents, iota subscript and diaeresis. A capital has its marks before it (*)/A).
  3. A mark that the query puts on a letter must stand on that letter in the text. A letter that the query gives without marks matches any. EA/N finds ἐάν but not ἐὰν; EAN finds both. A query with no marks gives the same matches as without the rule.
  4. The rule also applies to near.

In betacode, | separates alternatives, so an iota subscript can only be given in Unicode Greek (τῇ). The dot under a letter is not a mark here; the layer says the reading is uncertain.

About one inscription in seven is printed with no accents at all, and an accented query does not find them. Use the rule to tell accented forms apart, not to count a word.

Example (2026-10-22): EA/N as a whole word gives 725 matches with accents="match", EA\N 2,456, and EAN 3,263 with no rule.

Two strings together (near)

The server scans for the second string only in the inscriptions that have a match of the first. It keeps a match of the first if the second stands within within lines of it (default 0, the same line; at most 20). Lines are counted by the line ends of the text, from the start of the inscription; faces and columns run on.

Example (2026-10-21): θεοις with near="ανεθηκ" in the same line gives 53 matches in 53 inscriptions: θεοις 51, θεοισι 2.

The counts

Example (2026-10-21): the stem ψηφισμ at word_start gives 5,609 matches in 3,802 inscriptions: ψηφισμα 3,945, ψηφισματα 766, ψηφισματι 374. The 3rd century BC has the most, 970 inscriptions, and also the highest rate, 52.9 per 1,000. The 5th century BC has 39.6, a rate of 4.8.

Example (2026-10-21): βουλη as a whole word gives 4,781 matches with layer=full and 3,070 with layer=on_stone. The difference is mostly matches that need a letter the editor restored.

A query in Latin letters

A person who types demos means δῆμος, but the search reads δεμος. So for a Greek search in Latin letters, the server also tries the query as an English spelling of Greek: e as ε or η, o as ο or ω, th as θ, ch as χ, ph as φ, ps as ψ, u as υ or ου, and -us at the end as -ος. It counts at most 16 such readings.

Example (2026-10-21): demos gives 293 matches of δεμος, most of them in Attica before 400 BC (δεμοσιον 77, δεμος 36) and in names (χαιρεδεμος 14). The answer adds that δημος has 11,225.

Which matches come back

find_parallels

Finds the inscriptions that share sequences of words with one inscription: formulae, an epigram cut again, the same text in two publications, a parallel for a gap.

  1. The server splits the inscription into words, by the rules of the search text. A word is whole only if the layer reads all its letters and no lost letter touches it. The layer is on_stone unless you ask for full.
  2. It takes each sequence of length words (default 3, from 2 to 6) in which every word is whole. A sequence that occurs twice in the inscription counts once.
  3. It reads every other inscription once, splits it the same way, and notes which of these sequences it has.
  4. For each sequence it counts the inscriptions that have it. A sequence found in many inscriptions is a formula; one found in few is rare.
  5. The score of an inscription is the sum, over the sequences it shares, of ln(N / (1 + n)), where N is the number of inscriptions in the corpus and n the number that have the sequence. This is the inverse document frequency of information retrieval. A rare sequence adds much; a formula found everywhere adds almost nothing.
  6. An inscription that shares at least 50% of the sequences is marked as probably the same text: another edition, or a copy. The inscription must have at least 3 sequences for this mark.
  7. The answer lists the inscriptions with the highest scores (15 unless you ask for more, at most 50). For each, it joins the shared sequences into stretches of the text and shows the longest first.

How to read the score

Why on_stone is the default: editors often restore a gap from the formula of another text. With restored words, a parallel can rest on the editor's restoration, not on the stone.

Region, site, publication and date limit the inscriptions it compares. Then the count n also covers only those inscriptions, so a sequence can look rarer than it is in the whole corpus.

Example (2026-10-21): IG II² 1 (PH2219), the honours for the Samians, has 394 sequences of 3 words on the stone. 2,158 inscriptions share at least one. First is IG I³ 127 (PH130), with 259 shared sequences, marked as the same text: it prints the first decree of the same stone. Next come Attic decrees that share the formula ἔδοξεν τῆι βουλῆι καὶ τῶι δήμωι, with scores of 110 and lower.

The lookup tools

Example (2026-10-21): note="epitaph" finds 17,364 inscriptions. Only 63,770 of the 230,078 inscriptions have a note. Attica has only 283, because the older IG volumes, which hold most Attic texts, have no notes.

Published methods

Questions about a method: [email protected].