1.0.7 • Published 2 months ago

transkribator v1.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
2 months ago

Transkribator

Cyrillic to Latin converter. Takes Belarusian, Russian and Ukranian text and outputs its representation in German, English or scientific transliteration.

See our live demo at dekoder.org.

Transkribator Example Image

Install

npm install transkribator

Usage

import { transcribe } from "transkribator"

transcribe("Грушевський Михайло Сергійович", { from: "uk", to: "en" })
// returns "Hrushevskyi Mykhailo Serhiiovych"

Or in the browser:

<script src="https://unpkg.com/transkribator"></script>
<script>
  const { transcribe } = transkribator
  transcribe("Валянцін Акудовіч", { from: "be", to: "scientific" })
  // returns "Valjancin Akudovič"
</script>

Options

The transcribe function accepts an object with the following optional settings as a second argument:

propertydefault valuedescription
from"ru"ISO-Code of the source language (can be "be", "ru" or "uk")
to"en"ISO-Code of the target language (can be "de", "en" or "scientific")
showDetailsfalseif set to true the function returns an object with more detailed information about the applied rules (see below).

Transcription/transliteration standards

The German transcription rules are based on the Duden recommendations.

Ukrainian to English is converted according to the official Ukrainian passport transliteration. (See cyrillic-to-translit-js for another implementation).

For scientific transliterations checkout this handout from the Slavic Department of the University of Cologne.

Advanced usage

Learn more about the applied rules with the showDetails option:

const result = transcribe("М. Сергійович Грушевський", { from: "uk", to "de", showDetails: true })
const { output, appliedRules } = result
console.log(output)
// "M. Serhijowytsch Hruschewsky"

for (const rule of appliedRules) {
  const { description, word, affectedLetters } = rule
  console.log(`– ${description} (${word})`)
}
// – й -> j zwischen zwei Vokalen (Сергійович)
// – й nicht wiedergegeben nach и (Грушевський)
1.0.7

2 months ago

1.0.6

2 months ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago