Skip to content

Commit

Permalink
firther simplificytion
Browse files Browse the repository at this point in the history
  • Loading branch information
khashashin committed May 26, 2024
1 parent e63f3ac commit ed4ff2f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 66 deletions.
60 changes: 57 additions & 3 deletions translit.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import translit from './translitMap';

/**
* This module provides a transliteration mapping and a function to apply transliteration
* based on a predefined mapping from one script to another.
Expand All @@ -25,7 +23,63 @@ import translit from './translitMap';
* The keys are the original characters, and the values are the corresponding transliterated characters.
* @constant {Object.<string, string>}
*/
export const translitMap: { [key: string]: string } = translit;
export const translitMap: { [key: string]: string } = {
"а": "a", "А": "A",
"аь": "ä", "Аь": "Ä", "аЬ": "ä", "АЬ": "Ä",
"б": "b", "Б": "B",
"в": "v", "В": "V",
"г": "g", "Г": "G",
"гӏ": "ġ", "Гӏ": "Ġ", "гӀ": "ġ", "ГӀ": "Ġ",
"ц": "c", "Ц": "C",
"цӏ": "ċ", "Цӏ": "Ċ", "цӀ": "ċ", "ЦӀ": "Ċ",
"д": "d", "Д": "D",
"е": "e", "Е": "E",
"ё": "ö", "Ё": "Ö",
"ж": "ƶ", "Ж": "Ƶ",
"з": "z", "З": "Z",
"и": "i", "И": "I",
"й": "y", "Й": "Y",
"к": "k", "К": "K",
"кх": "q", "Кх": "Q", "кХ": "q", "КХ": "Q",
"къ": "q̇", "Къ": "Q̇", "кЪ": "q̇", "КЪ": "Q̇",
"кӏ": "k̇", "Кӏ": "K̇", "кӀ": "k̇", "КӀ": "K̇",
"л": "l", "Л": "L",
"м": "m", "М": "M",
"н": "n", "Н": "N",
"о": "o", "О": "O",
"оь": "ö", "Оь": "Ö", "оЬ": "ö", "ОЬ": "Ö",
"п": "p", "П": "P",
"пӏ": "ṗ", "Пӏ": "Ṗ", "пӀ": "ṗ", "ПӀ": "Ṗ",
"р": "r", "Р": "R",
"с": "s", "С": "S",
"т": "t", "Т": "T",
"тӏ": "ṫ", "Тӏ": "Ṫ", "тӀ": "ṫ", "ТӀ": "Ṫ",
"у": "u", "У": "U",
"уь": "ü", "Уь": "Ü", "уЬ": "ü", "УЬ": "Ü",
"ф": "f", "Ф": "F",
"х": "x", "Х": "X",
"хь": "ẋ", "Хь": "Ẋ", "хЬ": "ẋ", "ХЬ": "Ẋ",
"хӏ": "h", "Хӏ": "H", "хӀ": "h", "ХӀ": "H",
"ч": "ç", "Ч": "Ç",
"чӏ": "ç̇", "Чӏ": "Ç̇", "чӀ": "ç̇", "ЧӀ": "Ç̇",
"ш": "ş", "Ш": "Ş",
"щ": "ş", "Щ": "Ş",
"ъ": "ə", "Ъ": "Ə",
"ы": "", "Ы": "",
"ь": "", "Ь": "",
"э": "e", "Э": "E",
"ю": "yu", "Ю": "Yu",
"я": "ya", "Я": "Ya",
"ӏ": "j", "Ӏ": "J",
"ггӏ": "ġġ", "Ггӏ": "Ġġ", "гГӏ": "ġĠ", "ГГӏ": "ĠĠ", "ГГӀ": "ĠĠ", "гГӀ": "ġĠ", "ГгӀ": "Ġġ", "ггӀ": "ġġ",
"ккх": "qq", "Ккх": "Qq", "кКх": "qQ", "ККх": "QQ", "ККХ": "QQ", "кКХ": "qQ", "КкХ": "Qq", "ккХ": "qq",
"ккъ": "q̇q̇", "Ккъ": "Q̇q̇", "кКъ": "q̇Q̇", "ККъ": "Q̇Q̇", "ККЪ": "Q̇Q̇", "кКЪ": "q̇Q̇", "КкЪ": "Q̇q̇", "ккЪ": "q̇q̇",
"ттӏ": "ṫṫ", "Ттӏ": "Ṫṫ", "тТӏ": "ṫṪ", "ТТӏ": "ṪṪ", "ТТӀ": "ṪṪ", "тТӀ": "ṫṪ", "ТтӀ": "Ṫṫ", "ттӀ": "ṫṫ",
"ххь": "ẋẋ", "Ххь": "Ẋẋ", "хХь": "ẋẊ", "ХХь": "ẊẊ", "ХХЬ": "ẊẊ", "хХЬ": "ẋẊ", "ХхЬ": "Ẋẋ", "ххЬ": "ẋẋ",
"ххӏ": "hh", "Ххӏ": "Hh", "хХӏ": "hH", "ХХӏ": "HH", "ХХӀ": "HH", "хХӀ": "hH", "ХхӀ": "Hh", "ххӀ": "hh",
"юь": "yü", "Юь": "Yü", "юЬ": "yü", "ЮЬ": "Yü",
"яь": "yä", "Яь": "Yä", "яЬ": "yä", "ЯЬ": "Yä"
};

/**
* Applies transliteration to a given word using the predefined transliteration mapping.
Expand Down
57 changes: 0 additions & 57 deletions translitMap.ts

This file was deleted.

6 changes: 0 additions & 6 deletions tsconfig.json

This file was deleted.

0 comments on commit ed4ff2f

Please sign in to comment.