Skip to content
greek conversion

convert

convert(input, from, to, options?): string

Defined in: src/core.ts:99 (opens in a new tab)

Converts text with a reader and a writer.

The conversion of convert() from the main entry point: unknown literals are preserved, and the result is canonical and idempotent for fixed formats and options, but a reverse conversion is not necessarily lossless; use convertDetailed when that distinction matters.

Without options, the defaults apply: the library’s own transliteration, the letters of the SBL Handbook of Style with the accents, iota subscript, diaeresis, and quantity marks that the Handbook leaves out.

string

Reader

The reader of the input’s format.

Writer

The writer of the output’s format.

PreparedOptions

A preset from ./presets, or what prepareOptions returns; the defaults if omitted.

string

import { convert } from "@humanities/greek-conversion/core";
import { betaCodeReader } from "@humanities/greek-conversion/beta-code";
import { greekWriter } from "@humanities/greek-conversion/greek";
convert("*)odusseu/s", betaCodeReader, greekWriter); // → Ὀδυσσεύς

If input is not a string, from not a reader, to not a writer, or options not prepared options.