You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

transkribator

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

transkribator

Cyrillic to Latin converter

1.0.7
latest
npmnpm
Version published
Weekly downloads
7
133.33%
Maintainers
1
Weekly downloads
 
Created
Source

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 и (Грушевський)

FAQs

Package last updated on 22 Mar 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts