Skip to content
greek conversion

convertGreekPassages

convertGreekPassages(input, to, options?): string

Defined in: src/mod.ts:334 (opens in a new tab)

Converts the Greek passages of a text, for Greek quoted in a text in another language, and copies the rest as it is, code unit by code unit.

A Greek passage is a run of Greek letters with their combining marks, and of the signs that only Greek uses, by their code points: the Greek question mark (U+037E), the ano teleia (U+0387), the koronis (U+1FBD), the spacing breathings and accents, and the keraiai (U+0374, which normalization makes U+02B9, and U+0375). Everything else is copied: the punctuation that Greek shares with other scripts (;, ?, ·, ', ’, -), whitespace, and the text around. The options apply to the passages; the rules of the conversion see the whole text, so that before ., Θ is an initial (Th.). The source is Greek: in Beta Code and transliteration, Latin letters are the Greek text. Into Greek, the passages are normalized in the style of the options.

string

Format

The format of the passages in the output.

ConversionOptions | PreparedOptions = {}

string

import { convertGreekPassages } from "@humanities/greek-conversion";
convertGreekPassages("see λόγος; also ‘ἀπ᾽ αὐτοῦ’", "transliteration");
// → see lógos; also ‘ap’ autoũ’

If input is not a string.

If the format is unknown; an OptionError (a RangeError) if a preset, an option key, or an option value is.