Giter Site home page Giter Site logo

sun-jiao / cyrillic-transliteration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opendatakosovo/cyrillic-transliteration

0.0 1.0 0.0 303 KB

Transliterate Cyrillic script to Latin script and vice versa.

Home Page: https://pub.dev/packages/cyrtranslit

License: MIT License

Dart 100.00%

cyrillic-transliteration's Introduction

DOI

Please note: the author of this repository has no knowledge of any languages ​​that use the Cyrillic characters. Any issues related to linguistics should be reported directly to the Python repository, and this repository will follow up after it is updated.

What is CyrTranslit?

A Dart package for bi-directional transliteration of Cyrillic script to Latin script and vice versa.

By default, transliterates for the Serbian language. A language flag can be set in order to transliterate to and from Bulgarian, Montenegrin, Macedonian, Mongolian, Russian, Serbian, Tajik, and Ukrainian.

What is transliteration?

Transliteration is the conversion of a text from one script to another. For instance, a Latin alphabet transliteration of the Serbian phrase "Мој ховеркрафт је пун јегуља" is "Moj hoverkraft je pun jegulja".

Citation

This package is based on the Python project cyrillic-transliteration which was originally authored by Open Data Kosovo.

A citation would be much appreciated if you use CyrTranslit in a research publication:

Georges Labrèche. (2023). CyrTranslit (v1.1.1). Zenodo. https://doi.org/10.5281/zenodo.7734906

BibTex entry:

@software{georges_labreche_2023_7734906,
  author       = {Georges Labrèche},
  title        = {CyrTranslit},
  month        = mar,
  year         = 2023,
  note         = {{A Python package for bi-directional 
                   transliteration of Cyrillic script to Latin script
                   and vice versa. Supports transliteration for
                   Bulgarian, Montenegrin, Macedonian, Mongolian,
                   Russian, Serbian, Tajik, and Ukrainian.}},
  publisher    = {Zenodo},
  version      = {v1.1.1},
  doi          = {10.5281/zenodo.7734906},
  url          = {https://doi.org/10.5281/zenodo.7734906}
}

Supporting research

CyrTranslit is actively used as a reliable tool to advance research! Here's an incomplete list of publications for research projects that have relied on CyrTranslit:

How do I install this?

CyrTranslit is Dart pub repository so it can be installed using pub add:

dart pub add cyrtranslit          # latest version
dart pub add cyrtranslit: version   # specific version
dart pub add cyrtranslit:'^version'  # minimum version

or you can also add this package to your pubspec.yaml file.

dependencies:
  cyrtranslit: ^1.0.0

What languages are supported?

CyrTranslit currently supports bi-directional transliteration of Bulgarian, Montenegrin, Macedonian, Mongolian, Russian, Serbian, Tajik, and Ukrainian:

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.supported())
['bg', 'me', 'mk', 'mn', 'ru', 'sr', 'tj', 'ua']

How do I use this?

Bulgarian

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Съединението прави силата!", langCode: "bg"))
"Săedinenieto pravi silata!"
print(cyrtranslit.lat2Cyr("Săedinenieto pravi silata!", langCode: "bg"))
"Съединението прави силата!"

Montenegrin

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Република", langCode: "me"))
"Republika"
print(cyrtranslit.lat2Cyr("Republika", langCode: "me"))
"Република"

Macedonian

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Моето летачко возило е полно со јагули", langCode: "mk"))
"Moeto letačko vozilo e polno so jaguli"
print(cyrtranslit.lat2Cyr("Moeto letačko vozilo e polno so jaguli", langCode: "mk"))
"Моето летачко возило е полно со јагули"

Mongolian

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Амрагаа Сүнжидмаагаа гэсээр ирлээ дээ хө-хө-хө", langCode: "mn"))
"Amragaa Sünjidmaagaa geseer irlee dee khö-khö-khö"
print(cyrtranslit.lat2Cyr("Amragaa Sünjidmaagaa geseer irlee dee khö-khö-khö", langCode: "mn"))
"Амрагаа Сүнжидмаагаа гэсээр ирлээ дээ хө-хө-хө"

Russian

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Моё судно на воздушной подушке полно угрей", langCode: "ru"))
"Moyo sudno na vozdushnoj podushke polno ugrej"
print(cyrtranslit.lat2Cyr("Moyo sudno na vozdushnoj podushke polno ugrej", langCode: "ru"))
"Моё судно на воздушной подушке полно угрей"

Serbian

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Мој ховеркрафт је пун јегуља"))
"Moj hoverkraft je pun jegulja"
print(cyrtranslit.lat2Cyr("Moj hoverkraft je pun jegulja"))
"Мој ховеркрафт је пун јегуља"

Tajik

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Ман мактуб навишта истодам", langCode: "tj"))
"Man maktub navišta istodam"
print(cyrtranslit.lat2Cyr("Man maktub navišta istodam", langCode: "tj"))
"Ман мактуб навишта истодам"

Ukrainian

import 'package:cyrtranslit/cyrtranslit.dart' as cyrtranslit;
print(cyrtranslit.cyr2Lat("Під лежачий камінь вода не тече", langCode: "ua"))
"Pid ležačyj kamin' voda ne teče"
print(cyrtranslit.lat2Cyr("Pid ležačyj kamin' voda ne teče", langCode: "ua"))
"Під лежачий камінь вода не тече"

How can I contribute?

You can include support for other Cyrillic script alphabets. Follow these steps in order to do so:

  1. Create a new transliteration dictionary in the mapping.dart_ dictionary.
  2. Watch out for cases where two consecutive Latin alphabet letters are meant to transliterate into a single Cyrillic script letter. These cases need to be explicitly checked for inside the lat2Cyr() function in transliterator.dart.
  3. Add test cases inside of cyrtranslit_test.dart.
  4. Update the documentation in the README.md.
  5. List yourself as one of the contributors.

Before tagging a release version and deploying to pub.dev:

  1. Update the version properties in pubspec.yaml.

A big thank you to everyone who contributed:

cyrillic-transliteration's People

Contributors

anonymousvoice1 avatar cclauss avatar georgeslabreche avatar ratijas avatar rominf avatar savagej avatar serbipunk avatar shurph avatar sparkycz avatar sun-jiao avatar syndamia avatar zjaume avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.