1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00

feat(packages): remove xsampa-to-ipa.js

This commit is contained in:
Kierán Meinhardt
2020-05-15 08:05:01 +02:00
parent afed1b91b2
commit 0285299f22

View File

@@ -1,371 +0,0 @@
#!/usr/bin/env node
"use strict";
const { createInterface } = require("readline");
const xsampa = [
"_R_F",
"J\\_<",
"_H_T",
"G\\_<",
"_B_L",
"|\\|\\",
"r\\`",
"<R>",
"g_<",
"<F>",
"d_<",
"b_<",
"_?\\",
"z\\",
"z`",
"X\\",
"x\\",
"_x",
"_X",
"_w",
"v\\",
"_v",
"U\\",
"t`",
"_t",
"_T",
"s\\",
"s`",
"r\\",
"r`",
"_r",
"R\\",
"_R",
"_q",
"p\\",
"_o",
"O\\",
"_O",
"n`",
"_n",
"N\\",
"_N",
"_m",
"M\\",
"_M",
"l\\",
"l`",
"_l",
"L\\",
"_L",
"_k",
"K\\",
"j\\",
"_j",
"J\\",
"I\\",
"h\\",
"_h",
"H\\",
"_H",
"G\\",
"_G",
"_F",
"_e",
"d`",
"_d",
"_c",
"B\\",
"_B",
"_a",
"_A",
"3\\",
"_0",
"@\\",
"?\\",
"!\\",
":\\",
"-\\",
"_+",
"_\\",
"_}",
'_"',
"_/",
"_-",
"_>",
"_=",
"_~",
"_^",
"|\\",
"||",
">\\",
"=\\",
"<\\",
"Z",
"z",
"y",
"Y",
"X",
"x",
"w",
"W",
"v",
"V",
"u",
"U",
"T",
"t",
"s",
"S",
"r",
"R",
"q",
"Q",
"p",
"P",
"O",
"o",
"N",
"n",
"m",
"M",
"l",
"L",
"k",
"K",
"j",
"J",
"i",
"I",
"h",
"H",
"g",
"G",
"f",
"F",
"E",
"e",
"@",
"D",
"d",
"C",
"c",
"B",
"b",
"{",
"a",
"A",
"9",
"8",
"7",
"6",
"5",
"4",
"3",
"2",
"1",
"%",
"&",
"}",
'"',
"'",
".",
"?",
"!",
":",
"|",
"=",
"~",
"^",
"`"
];
const ipa = [
" ᷈",
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",
"˞"
];
const convertChar = (inputList, outputList) => input => {
const index = inputList.findIndex(letter => letter == input);
return index ? outputList[index] : input;
};
const convertString = (inputList, outputList) => string =>
string
.split("")
.map(convertChar(inputList, outputList))
.join("");
const ipaToXsampa = convertString(ipa, xsampa);
const xsampaToIpa = convertString(xsampa, ipa);
const readlineInterface = createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
readlineInterface.on("line", line => console.log(xsampaToIpa(line)));