От Дмитрия Соловей — @solovey_nchub
Данная формула выполняет транслитерацию rus-to-lat
let({
ru: "Съешь же ещё этих мягких французских булок, да выпей чаю",
text: lower(ru),
dict: {
a: ["а","a"],
b: ["б","b"],
v: ["в","v"],
g: ["г","g"],
d: ["д","d"],
e: ["е","e"],
yo: ["ё","yo"],
zh: ["ж","zh"],
z: ["з","z"],
i: ["и","i"],
ik: ["й","i"],
k: ["к","k"],
l: ["л","l"],
m: ["м","m"],
n: ["н","n"],
o: ["о","o"],
p: ["п","p"],
r: ["р","r"],
s: ["с","s"],
t: ["т","t"],
u: ["у","u"],
f: ["ф","f"],
h: ["х","kh"],
ts: ["ц","ts"],
ch: ["ч","ch"],
sh: ["ш","sh"],
sha: ["щ","sha"],
tz: ["ъ",""],
bi: ["ы","i"],
mz: ["ь",""],
ee: ["э","e"],
yu: ["ю","yu"],
ya: ["я","ya"],
space: [" ", "-"],
sim: ["!",""],
zpt: [",",""]
},
rep0: replaceAll(text, dict.a[0], dict.a[1]),
rep1: replaceAll(rep0, dict.b[0], dict.b[1]),
rep2: replaceAll(rep1, dict.v[0], dict.v[1]),
rep3: replaceAll(rep2, dict.g[0], dict.g[1]),
rep4: replaceAll(rep3, dict.d[0], dict.d[1]),
rep5: replaceAll(rep4, dict.e[0], dict.e[1]),
rep6: replaceAll(rep5, dict.yo[0], dict.yo[1]),
rep7: replaceAll(rep6, dict.zh[0], dict.zh[1]),
rep8: replaceAll(rep7, dict.z[0], dict.z[1]),
rep9: replaceAll(rep8, dict.i[0], dict.i[1]),
rep10: replaceAll(rep9, dict.ik[0], dict.ik[1]),
rep11: replaceAll(rep10, dict.k[0], dict.k[1]),
rep12: replaceAll(rep11, dict.l[0], dict.l[1]),
rep13: replaceAll(rep12, dict.m[0], dict.m[1]),
rep14: replaceAll(rep13, dict.n[0], dict.n[1]),
rep15: replaceAll(rep14, dict.o[0], dict.o[1]),
rep16: replaceAll(rep15, dict.p[0], dict.p[1]),
rep17: replaceAll(rep16, dict.r[0], dict.r[1]),
rep18: replaceAll(rep17, dict.s[0], dict.s[1]),
rep19: replaceAll(rep18, dict.t[0], dict.t[1]),
rep20: replaceAll(rep19, dict.u[0], dict.u[1]),
rep21: replaceAll(rep20, dict.f[0], dict.f[1]),
rep22: replaceAll(rep21, dict.h[0], dict.h[1]),
rep23: replaceAll(rep22, dict.ts[0], dict.ts[1]),
rep24: replaceAll(rep23, dict.sh[0], dict.sh[1]),
rep25: replaceAll(rep24, dict.sha[0], dict.sha[1]),
rep26: replaceAll(rep25, dict.tz[0], dict.tz[1]),
rep27: replaceAll(rep26, dict.bi[0], dict.bi[1]),
rep28: replaceAll(rep27, dict.mz[0], dict.mz[1]),
rep29: replaceAll(rep28, dict.ee[0], dict.ee[1]),
rep30: replaceAll(rep29, dict.yu[0], dict.yu[1]),
rep31: replaceAll(rep30, dict.ya[0], dict.ya[1]),
rep32: replaceAll(rep31, dict.space[0], dict.space[1]),
rep33: replaceAll(rep32, dict.ch[0], dict.ch[1]),
rep34: replaceAll(rep33, dict.zpt[0], dict.zpt[1]),
result: replaceAll(rep34, dict.sim[0], dict.sim[1]),
},
result)
Транслитерация русской строки в латиницу с заменой пробелов на дефисы и удалением
Простой текст
Работает на Creatium