1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace LoginGenerator.Models
- {
- public class Transliteration
- {
- readonly Dictionary<char, string> characters = new Dictionary<char, string>
- {
- { 'А', "A" }, { 'а', "a" },
- { 'Б', "B" }, { 'б', "b" },
- { 'В', "V" }, { 'в', "v" },
- { 'Г', "G" }, { 'г', "g" },
- { 'Д', "D" }, { 'д', "d" },
- { 'Е', "E" }, { 'е', "e" },
- { 'Ё', "E" }, { 'ё', "e" },
- { 'Ж', "Zh" }, { 'ж', "zh" },
- { 'З', "Z" }, { 'з', "z" },
- { 'И', "I" }, { 'и', "i" },
- { 'Й', "I" }, { 'й', "i" },
- { 'К', "K" }, { 'к', "k" },
- { 'Л', "L" }, { 'л', "l" },
- { 'М', "M" }, { 'м', "m" },
- { 'Н', "N" }, { 'н', "n" },
- { 'О', "O" }, { 'о', "o" },
- { 'П', "P" }, { 'п', "p" },
- { 'Р', "R" }, { 'р', "r" },
- { 'С', "S" }, { 'с', "s" },
- { 'Т', "T" }, { 'т', "t" },
- { 'У', "U" }, { 'у', "u" },
- { 'Ф', "F" }, { 'ф', "f" },
- { 'Х', "Kh" }, { 'х', "kh" },
- { 'Ц', "Tc" }, { 'ц', "tc" },
- { 'Ч', "Ch" }, { 'ч', "ch" },
- { 'Ш', "Sh" }, { 'ш', "sh" },
- { 'Щ', "Shch" }, { 'щ', "shch" },
- { 'Ъ', "" }, { 'ъ', "" },
- { 'Ы', "Y" }, { 'ы', "y" },
- { 'Ь', "" }, { 'ь', "" },
- { 'Э', "E" }, { 'э', "e" },
- { 'Ю', "Iu" }, { 'ю', "iu" },
- { 'Я', "Ia" }, { 'я', "ia" },
- { ' ', " " }, { '.', "." }
- };
- public string Execute(string originalString)
- {
- string transliteratedString = "";
- foreach (char c in originalString)
- transliteratedString += characters[c];
- return transliteratedString;
- }
- }
- }
|