Skip to content

0.13.0 (March 10, 2024)

Compare
Choose a tag to compare
@antoineboquet antoineboquet released this 10 Mar 12:55
· 150 commits to master since this release
cfba815

This release contains new features & fixes, including breaking changes.

Design changes

Note

As the library matures, some aspects need to be polished. Consider that the points below are now fixed.

Shorter names, saved bytes: some names among the conversion options have been shorten — without sacrificing meaning:

  1. useGreekStyle -> greekStyle;
  2. useTransliterationStyle -> transliterationStyle;
  3. useAdditionalChars -> additionalChars.

Features

ISO 843 (1997) transliteration

This release adds support for the ISO 843 (1997) norm as a new preset named Preset.ISO:

import { KeyType, toTransliteration } from 'greek-conversion'

const greekStr =
  'Ὧν ἡ σοφία παρασκευάζεται εἰς τὴν ' +
  'τοῦ ὅλου βίου μακαριότητα πολὺ μέγιστόν ' +
  'ἐστιν ἡ τῆς φιλίας κτῆσις.'

toTransliteration(
  greekStr,         // Hō̃n hī sofía paraskeuázetai eis tī̀n
  KeyType.GREEK,    // toũ hólou víou makariótīta polỳ mégistón
  Preset.ISO        // estin hī tī̃s filías ktī̃sis.
)

Thesaurus Linguae Graecae beta code

It also adds support for the classical Thesaurus Linguae Graecae beta code:

  1. input: by adding a new input type (KeyType.TLG_BETA_CODE);
  2. output: by extending the IConversionOptions interface with a betaCodeStyle.useTLGStyle option.
Input TLG beta code
import { KeyType, toGreek } from 'greek-conversion'
toGreek('*)/AI+DA', KeyType.TLG_BETA_CODE) // Ἄϊδα
Ouput TLG beta code
betaCodeStyle?: {
  useTLGStyle?: boolean // use the Thesaurus Linguae Graecae style. e.g. 'Ἄϊδι' → '*)/AI+DI'
}

Moreover, you can use the new preset Preset.TLG that acts as a shortcut to use this style, alongside Preset.MODERN_BC which is the default 'modernized' beta code provided by the previous versions of the library.

import { KeyType, Preset, toBetaCode } from 'greek-conversion'

toBetaCode('Ἄϊδα', KeyType.GREEK, Preset.MODERN_BC)  // A)/i+da
toBetaCode('Ἄϊδα', KeyType.GREEK, Preset.TLG)        // *)/AI+DA

Transliterated coronis style

A transliterationStyle.setCoronisStyle option has been added. It accepts a Coronis enum whose values ​​are PSILI | APOSTROPHE | NO. Default value is Coronis.PSILI ('psili' is the unicode name for smooth breathings).

import { Coronis, KeyType, toTransliteration } from 'greek-conversion'

toTransliteration('κἀγώ', KeyType.GREEK) // ka̓gṓ (defaults to Coronis.PSILI )
toTransliteration('κἀγώ', KeyType.GREEK, { transliterationStyle: { setCoronisStyle: Coronis.APOSTROPHE } }) // ka’gṓ
toTransliteration('κἀγώ', KeyType.GREEK, { transliterationStyle: { setCoronisStyle: Coronis.NO } }) // kagṓ

Other changes

  • A number of new options has been added to transliterationStyle in order to enable alternative transliterated letters: beta_v, eta_i & phi_f.
  • Beta code diacritics order is now fully normalized, input & output.
  • A greekStyle.useGreekQuestionMark option has been added and is enabled for Preset.BNF only (the default question mark is now a regular semicolon [U+003B]).
  • transliterationStyle.upsilon_y has a new value Preset.ISO. This value applies 'y' everywhere except for diphthongs 'au', 'eu', 'ou' (the default behavior preserves diphthongs 'au', 'eu', 'ēu', 'ou', 'ui', 'ōu').
  • Build: parcel settings have been revised.
  • NPM package: ship minified files only & better ESM/CommonJS handling.

Fixes

  • Transliteration (self conversion): case checking for xi_ks & chi_kh options was wrong.
  • Preset.BNF should use the upsilon_y option (with the new value Preset.ISO).