Compare commits
55 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
cb15388d1f | ||
|
9cc61b33fe | ||
|
1a4245b158 | ||
|
9df5030b66 | ||
|
f0fecd3575 | ||
|
b7b1c797a6 | ||
|
c40cf7be38 | ||
|
a9a8d2392a | ||
|
fdf21bf0eb | ||
|
a4962f03a5 | ||
|
8b8a9d9a89 | ||
|
b9defd6d12 | ||
|
d79cba5035 | ||
|
d672d08645 | ||
|
2ec17be818 | ||
|
711f4725d0 | ||
|
70fad99e71 | ||
|
268f73a9ce | ||
|
4b313d6dcd | ||
|
059e83aa16 | ||
|
c8b721bf80 | ||
|
e34de2f569 | ||
|
002b941ee7 | ||
|
cea04d0e2a | ||
|
81a205f781 | ||
|
75d4d41744 | ||
|
bb4b7a6534 | ||
|
614287c31b | ||
|
919ee380d2 | ||
|
6f8f06d5e2 | ||
|
3770b228e7 | ||
|
46a288c041 | ||
|
bcb7b6339a | ||
|
388871958d | ||
|
7c7f7bff0f | ||
|
05897831ed | ||
|
2f999368a3 | ||
|
1d34c6118b | ||
|
daa52c41d0 | ||
|
c51c945660 | ||
|
641669f243 | ||
|
eb61eb1617 | ||
|
7a7b9606cd | ||
|
8ba54948b4 | ||
|
771b8dba3d | ||
|
13d76e06f3 | ||
|
66ef8c5c40 | ||
|
8e36cc67bb | ||
|
46019faa9d | ||
|
f4a1354eaa | ||
|
e54be5da02 | ||
|
7063a47da0 | ||
|
1cb6d03765 | ||
|
db06cde48a | ||
|
c6b03d35c0 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
config.json
|
||||
node_modules
|
||||
build
|
21
.gitlab-ci.yml
Normal file
21
.gitlab-ci.yml
Normal file
@ -0,0 +1,21 @@
|
||||
stages:
|
||||
- build
|
||||
- deploy
|
||||
|
||||
|
||||
image: node:10-slim
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- npm install
|
||||
- npm run build
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
script:
|
||||
- echo "Deploy to dodsorf.as"
|
||||
environment:
|
||||
name: wug dodsorf.as
|
||||
only:
|
||||
- master
|
@ -4,5 +4,6 @@ WORKDIR /server
|
||||
COPY . /server
|
||||
|
||||
RUN npm install
|
||||
RUN mkdir build && npm run build
|
||||
|
||||
CMD [ "npm", "start" ]
|
||||
|
22
README.md
22
README.md
@ -10,18 +10,20 @@ p[x2"owis x1"ek'wo:s-kve] gives *h₂ówis h₁é"kwōs-kʷe
|
||||
|
||||
Guides to these systems can be found here:
|
||||
X-sampa: https://en.wikipedia.org/wiki/X-SAMPA
|
||||
Z-sampa: http://www.kneequickie.com/kq/Z-SAMPA
|
||||
For the PIE notation:
|
||||
|
||||
* a preceding " is acute accent
|
||||
* a following : is the macron
|
||||
* a following . is the syllabicity marker
|
||||
* h always becomes superscript and v is superscript w.
|
||||
* Palato-velars are marked with a following ' and x1, x2, x3 etc. yields the laryngeals, with x@ for the subscript a laryngeal, and xx for an unknown laryngeal.
|
||||
Z-sampa: https://web.archive.org/web/20191116002807/http://kneequickie.com/kq/Z-SAMPA
|
||||
APIE: https://gist.github.com/xsduan/8ebd580be71214c57aa554ec9050916c
|
||||
|
||||
This is best learned by experimenting.
|
||||
|
||||
These conversions were originally taken from [xsduan/conniebot](https://github.com/xsduan/conniebot). But have later divirged a bit.
|
||||
Inuktitut Syllabics: https://en.wikipedia.org/wiki/Inuktitut_syllabics
|
||||
|
||||
Iñupiatun Orthography:
|
||||
|
||||
* & for miniscule ł
|
||||
* l% and n% for ł and ñ each
|
||||
* g^, l^, &^ (or l%^ and l^%) n^, and r^ for ġ ḷ ł̣ ŋ ȓ each
|
||||
|
||||
These conversions were originally taken from [xsduan/conniebot](https://github.com/xsduan/conniebot), and the discord bot Tuugaalikkuluk (thanks!) But have later divirged a bit.
|
||||
|
||||
To use the bot I run an instance at [@wug:dodsorf.as](https://matrix.to/#/@wug:dodsorf.as), you can invite it to a room or DM it to use the converter. Or you can read the setup instructions below to host your own!
|
||||
|
||||
@ -37,4 +39,4 @@ You could also build a docker image but you're on your own there!
|
||||
`npm install` and `npm start`
|
||||
|
||||
If you use nix you can run shell.nix to get node and npm in your environment.
|
||||
If you use direnv you can also load the shell automatically
|
||||
If you use direnv you can also load the shell automatically
|
||||
|
89
index.ts
89
index.ts
@ -1,16 +1,13 @@
|
||||
const version = "1.1.2";
|
||||
const version = "2.4.4";
|
||||
import x2i from "./x2i";
|
||||
import { existsSync } from "fs";
|
||||
|
||||
const config = (existsSync("./config.json")) ? require("./config.json") : {};
|
||||
|
||||
console.log(process.env.MATRIXDEV_HOMESERVER);
|
||||
console.log(process.env.MATRIXDEV_TOKEN);
|
||||
|
||||
const MatrixClient = require("matrix-bot-sdk").MatrixClient;
|
||||
const AutojoinRoomsMixin = require("matrix-bot-sdk").AutojoinRoomsMixin;
|
||||
|
||||
const homeserver = (config.homeserver || process.env.WUG_HOMESERVER || process.env.MATRIXDEV_HOMESERVER);
|
||||
const homeserver = (config.homeserver || process.env.WUG_HOMESERVER || process.env.MATRIXDEV_HOMESERVER);
|
||||
const token = (config.token || process.env.WUG_TOKEN || process.env.MATRIXDEV_TOKEN);
|
||||
|
||||
const client = new MatrixClient(homeserver, token);
|
||||
@ -27,8 +24,13 @@ async function handle(roomId, event) {
|
||||
|
||||
if (event.unsigned.age > 1000 * 60) { console.log("Message was old!"); return; };
|
||||
if (event.sender === await myself) { console.log("Wait a minute... That's me!"); return;};
|
||||
if (event.content.msgtype === "m.notice") { return; };
|
||||
|
||||
if (event.content.body === "!xhelp" || event.content.body === (await client.getUserProfile(await myself)).displayname + ": help") {help(roomId); return;};
|
||||
if (event.content.body === "!xik") {xik(roomId); return;};
|
||||
if (event.content.body === "!xpie") {xpie(roomId); return;};
|
||||
if (event.content.body === "!xchr") {xchr(roomId); return;};
|
||||
if (event.content.body === "!xnav") {xnav(roomId); return;};
|
||||
if (event.content.body === "!xdebug") {debug(roomId); return;};
|
||||
|
||||
console.log("Trying to convert the message!");
|
||||
@ -41,15 +43,84 @@ async function handle(roomId, event) {
|
||||
|
||||
|
||||
function help(roomId) {
|
||||
var message = `Hi I can help you translate X-SAMPA, Z-SAMPA to IPA, and transcribe into proto-indo european notation!
|
||||
Use (x/z/p) together with either / or [] as delimeters
|
||||
x/"hEloU/ z[or\` 5aIk DIz] p/mreghnom/ 😀
|
||||
var message = `Hi I am a general language bot!
|
||||
To use me, type a key together with either / or [] as delimeters
|
||||
|
||||
Find my source at https://github.com/Dali99/matrix-wug`;
|
||||
x - X-SAMPA - https://en.wikipedia.org/wiki/X-SAMPA
|
||||
z - Z-SAMPA - https://web.archive.org/web/20191116002807/http://kneequickie.com/kq/Z-SAMPA
|
||||
p - Proto-Indo-European Notation - https://gist.github.com/xsduan/8ebd580be71214c57aa554ec9050916c
|
||||
i - Inuktitut Syllabics - https://en.wikipedia.org/wiki/Inuktitut_syllabics
|
||||
ik - Iñupiatun Orthographies (see !xik)
|
||||
chr - Cherokee (see !xchr) - https://en.wikipedia.org/wiki/Cherokee_syllabary
|
||||
nav - Navajo (see !xnav)
|
||||
hi - Hiragana, mainly https://en.wikipedia.org/wiki/Nihon-shiki_romanization and hepburn, but also with other unofficial styles
|
||||
|
||||
Find my source at https://github.com/Dali99/matrix-wug
|
||||
|
||||
EXAMPLES:
|
||||
x/"hEloU/ - /ˈhɛloʊ/
|
||||
z[or\` 5aIk DIz] - [oɽ ɫaɪk ðɪz]
|
||||
`;
|
||||
|
||||
client.sendNotice(roomId, message);
|
||||
}
|
||||
|
||||
function xpie(roomId) {
|
||||
var message = `This is a fun PIE notation
|
||||
|
||||
a preceding " is acute accent
|
||||
a following : is the macron
|
||||
a following . is the syllabicity marker
|
||||
h always becomes superscript and v is superscript w.
|
||||
Palato-velars are marked with a following ' and x1, x2, x3 etc. yields the laryngeals, with x@ for the subscript a laryngeal, and xx for an unknown laryngeal.
|
||||
|
||||
There's probably more, but this is best learned by experimenting (or reading https://gist.github.com/xsduan/8ebd580be71214c57aa554ec9050916c)
|
||||
|
||||
Thanks to conniebot (xsduan) for the encoding`;
|
||||
|
||||
client.sendNotice(roomId, message);
|
||||
}
|
||||
|
||||
function xik(roomId) {
|
||||
var message = `There are several distinct Iñupiatun orthographies, and I can type all of them.
|
||||
& for miniscule ł
|
||||
l% and n% for ł and ñ each
|
||||
g^, l^, &^ (or l%^ and l^%) n^, and r^ for ġ ḷ ł̣ ŋ ȓ each
|
||||
|
||||
Thanks to Tuugaalikkuluk for the encoding`;
|
||||
|
||||
client.sendNotice(roomId, message);
|
||||
}
|
||||
|
||||
function xchr(roomId) {
|
||||
var message = `I'm sadly not smart enough to know which syllable to use in certain situations.
|
||||
That means you have to help me out a little.
|
||||
Write the wanted syllables down, but separate them by a dot (.) or an apostrophe (')
|
||||
|
||||
Thanks to Tuugaalikkuluk for the encoding
|
||||
|
||||
EXAMPLES:
|
||||
chr/tsa.la.gi ga.wo.ni.hi.s.di/ - ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ`;
|
||||
|
||||
client.sendNotice(roomId, message);
|
||||
}
|
||||
|
||||
function xnav(roomId) {
|
||||
var message = `My navajo encoding is as follows:
|
||||
Caron after a vowel gives it an acute accent: o^ → ó, A^ → Á
|
||||
At sign after a vowel gives it an ogonek: a@ → ą, E@ → Ę
|
||||
Percentage sign after a vowel gives it both an ogonek and an acute accent: a% → ą́, I% → Į́ and after an l, it makes ł: l% → ł
|
||||
You can also "stack the symbols" for an ogonek and an accute accent: (a^@, a@^) → ą́
|
||||
Single quotation mark is converted to the glottal stop/ejective mark (’)
|
||||
For a plain quotation mark, you can type '^
|
||||
|
||||
Thanks to Tuugaalikkuluk for the encoding`;
|
||||
|
||||
client.sendNotice(roomId, message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function debug(roomId) {
|
||||
var message = `Hi my name is ${await myself}, and I want to help you debug me!
|
||||
I run version ${version} 💝 and currently reside in ${roomId}`;
|
||||
|
3531
package-lock.json
generated
3531
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,22 +1,22 @@
|
||||
{
|
||||
"name": "vugg",
|
||||
"version": "1.1.0",
|
||||
"name": "matrix-wug",
|
||||
"version": "2.4.3",
|
||||
"description": "Language bot for matrix",
|
||||
"main": "index.js",
|
||||
"bin": "build/index.js",
|
||||
"scripts": {
|
||||
"start": "nodemon --exitcrash --ignore *.sqlite -x ts-node index.ts"
|
||||
"build": "tsc",
|
||||
"start": "node build/index.js"
|
||||
},
|
||||
"author": "Daniel",
|
||||
"license": "ISC",
|
||||
"license": "AGPL3",
|
||||
"dependencies": {
|
||||
"matrix-bot-sdk": "^0.3.2",
|
||||
"@types/js-yaml": "^3.11.2",
|
||||
"@types/js-yaml": "^3.12.1",
|
||||
"@types/node": "^10.12.11",
|
||||
"@types/xregexp": "^3.0.29",
|
||||
"js-yaml": "^3.12.0",
|
||||
"ts-node": "^7.0.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"typescript": "^3.2.1",
|
||||
"xregexp": "^4.2.0",
|
||||
"nodemon": "^1.18.7"
|
||||
"xregexp": "^4.2.0"
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
with import <nixpkgs> {};
|
||||
stdenv.mkDerivation {
|
||||
name = "node";
|
||||
buildInputs = [ nodejs ];
|
||||
buildInputs = [ nodejs-10_x yarn ];
|
||||
shellHook = ''
|
||||
export PATH="$PWD/node_modules/.bin/:$PATH"
|
||||
'';
|
||||
|
8
tsconfig.json
Normal file
8
tsconfig.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"outDir": "build"
|
||||
},
|
||||
"files": [
|
||||
"index.ts"
|
||||
]
|
||||
}
|
@ -1,4 +1,12 @@
|
||||
---
|
||||
- - '"l.:'
|
||||
- l̥̄́
|
||||
- - '"m.:'
|
||||
- m̥̥̄́
|
||||
- - '"n.:'
|
||||
- n̥̄́
|
||||
- - '"r.:'
|
||||
- r̥̄́
|
||||
- - '"a:'
|
||||
- ā́
|
||||
- - '"e:'
|
||||
@ -90,12 +98,4 @@
|
||||
- - x@
|
||||
- hₐ
|
||||
- - xx
|
||||
- hₓ
|
||||
- - '"l.':
|
||||
- l̥̄́
|
||||
- - '"m.':
|
||||
- m̥̥̄́
|
||||
- - '"n.':
|
||||
- n̥̄́
|
||||
- - '"r.':
|
||||
- r̥̄́
|
||||
- hₓ
|
134
x2i/dictionaries/chr.ts
Normal file
134
x2i/dictionaries/chr.ts
Normal file
@ -0,0 +1,134 @@
|
||||
export function convert(input: string)
|
||||
{
|
||||
console.log("Converting to cherokee!!!");
|
||||
var c=" ";
|
||||
var i=0;
|
||||
var j=0;
|
||||
var k=0;
|
||||
var flag=0;
|
||||
var rom=input+" ";
|
||||
const cons=["g","k","h","l","m","n","q","s","d","t","c","j","w","y","qu","qw","gw","kw","dl","tl","ts","ch","dz"];
|
||||
const vowel=["a","e","i","o","u","v"];
|
||||
const syl=[["Ꭶ","Ꭸ","Ꭹ","Ꭺ","Ꭻ","Ꭼ"],["Ꭷ","Ꭸ","Ꭹ","Ꭺ","Ꭻ","Ꭼ"],["Ꭽ","Ꭾ","Ꭿ","Ꮀ","Ꮁ","Ꮂ"],["Ꮃ","Ꮄ","Ꮅ","Ꮆ","Ꮇ","Ꮈ"],["Ꮉ","Ꮊ","Ꮋ","Ꮌ","Ꮍ","Ᏽ"],["Ꮎ","Ꮑ","Ꮒ","Ꮓ","Ꮔ","Ꮕ"],["Ꮖ","Ꮗ","Ꮘ","Ꮙ","Ꮚ","Ꮛ"],["Ꮜ","Ꮞ","Ꮟ","Ꮠ","Ꮡ","Ꮢ"],["Ꮣ","Ꮥ","Ꮧ","Ꮩ","Ꮪ","Ꮫ"],["Ꮤ","Ꮦ","Ꮨ","Ꮩ","Ꮪ","Ꮫ"],["Ꮳ","Ꮴ","Ꮵ","Ꮶ","Ꮷ","Ꮸ"],["Ꮳ","Ꮴ","Ꮵ","Ꮶ","Ꮷ","Ꮸ"],["Ꮹ","Ꮺ","Ꮻ","Ꮼ","Ꮽ","Ꮾ"],["Ꮿ","Ᏸ","Ᏹ","Ᏺ","Ᏻ","Ᏼ"],["Ꮖ","Ꮗ","Ꮘ","Ꮙ","Ꮚ","Ꮛ"],["Ꮖ","Ꮗ","Ꮘ","Ꮙ","Ꮚ","Ꮛ"],["Ꮖ","Ꮗ","Ꮘ","Ꮙ","Ꮚ","Ꮛ"],["Ꮖ","Ꮗ","Ꮘ","Ꮙ","Ꮚ","Ꮛ"],["Ꮬ","Ꮮ","Ꮯ","Ꮰ","Ꮱ","Ꮲ"],["Ꮭ","Ꮮ","Ꮯ","Ꮰ","Ꮱ","Ꮲ"],["Ꮳ","Ꮴ","Ꮵ","Ꮶ","Ꮷ","Ꮸ"],["Ꮳ","Ꮴ","Ꮵ","Ꮶ","Ꮷ","Ꮸ"],["Ꮳ","Ꮴ","Ꮵ","Ꮶ","Ꮷ","Ꮸ"]];
|
||||
while (rom.length>1) {
|
||||
i=0;
|
||||
while(isAlpha(rom[i])) {
|
||||
i=i+1;
|
||||
}
|
||||
if (i==0) {
|
||||
if (rom[0]=="#") break;
|
||||
c=c+rom[0];
|
||||
rom=rom.slice(1);
|
||||
}
|
||||
else if (i==1) {
|
||||
if (rom[0].toLowerCase()=='a') {
|
||||
c=c+'Ꭰ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2)
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else if (rom[0].toLowerCase()=='e') {
|
||||
c=c+'Ꭱ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2);
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else if (rom[0].toLowerCase()=='i') {
|
||||
c=c+'Ꭲ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2);
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else if (rom[0].toLowerCase()=='o') {
|
||||
c=c+'Ꭳ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2);
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else if (rom[0].toLowerCase()=='u') {
|
||||
c=c+'Ꭴ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2);
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else if (rom[0].toLowerCase()=='v') {
|
||||
c=c+'Ꭵ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2);
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else if (rom[0].toLowerCase()=='s') {
|
||||
c=c+'Ꮝ';
|
||||
if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2);
|
||||
else rom=rom.slice(1);
|
||||
}
|
||||
else {
|
||||
c=c+rom.slice(0,2);;
|
||||
rom=rom.slice(2);;
|
||||
};
|
||||
}
|
||||
else if (i==2) {
|
||||
j=0;
|
||||
k=0;
|
||||
flag=0;
|
||||
for (var j = 0; j < 14; j++) {
|
||||
if (rom[0].toLowerCase()==cons[j]) {
|
||||
for (var k = 0; k < 6; k++) {
|
||||
if (rom[1].toLowerCase()==vowel[k]) {
|
||||
flag=1;
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
if(flag) break;
|
||||
};
|
||||
if(flag) {
|
||||
c=c+syl[j][k];
|
||||
if((rom[2] == "." || rom[2] == "'")&& isAlpha(rom[3])) rom=rom.slice(3);
|
||||
else rom=rom.slice(2);
|
||||
}
|
||||
else {
|
||||
c=c+rom.slice(0, 3);
|
||||
rom=rom.slice(3);
|
||||
};
|
||||
}
|
||||
else if (i==3) {
|
||||
j=0;
|
||||
k=0;
|
||||
flag=0;
|
||||
for (j = 14; j < 23; j++) {
|
||||
if (rom.slice(0,2).toLowerCase()==cons[j]) {
|
||||
for (k = 0; k < 6; k++) {
|
||||
if (rom[2].toLowerCase()==vowel[k]) {
|
||||
flag=1;
|
||||
break;
|
||||
};
|
||||
};
|
||||
};
|
||||
if(flag) break;
|
||||
};
|
||||
if(flag) {
|
||||
c=c+syl[j][k];
|
||||
if((rom[3] == "." || rom[3] == "'") && isAlpha(rom[4])) rom=rom.slice(4);
|
||||
else rom=rom.slice(3);
|
||||
}
|
||||
else if (rom.slice(0,3).toLowerCase()=="nah") {
|
||||
c=c+"Ꮐ";
|
||||
if((rom[3] == "." || rom[3] == "'") && isAlpha(rom[4])) rom=rom.slice(4);
|
||||
else rom=rom.slice(3);
|
||||
}
|
||||
else if (rom.slice(0,3).toLowerCase()=="hna") {
|
||||
c=c+"Ꮏ";
|
||||
if((rom[3] == "." || rom[3] == "'") && isAlpha(rom[4])) rom=rom.slice(4);
|
||||
else rom=rom.slice(3);
|
||||
}
|
||||
else {
|
||||
c=c+rom.slice(0, 4);
|
||||
rom=rom.slice(4);
|
||||
};
|
||||
}
|
||||
else {
|
||||
c=c+rom.slice(0,i+1);
|
||||
rom=rom.slice(i+1);
|
||||
};
|
||||
};
|
||||
return c;
|
||||
}
|
||||
|
||||
function isAlpha(ch: string){
|
||||
return /^[A-Z]$/i.test(ch);
|
||||
}
|
674
x2i/dictionaries/hi-keys.yaml
Normal file
674
x2i/dictionaries/hi-keys.yaml
Normal file
@ -0,0 +1,674 @@
|
||||
---
|
||||
# n has supesharu sutâtsusu
|
||||
- raw:
|
||||
- "n'"
|
||||
- "ん"
|
||||
|
||||
# hepburn long vowels
|
||||
- raw:
|
||||
- "[āâ]"
|
||||
- "aa"
|
||||
- raw:
|
||||
- "[ūû]"
|
||||
- "uu"
|
||||
- raw:
|
||||
- "[ūû]"
|
||||
- "uu"
|
||||
- raw:
|
||||
- "[ēê]"
|
||||
- "ee"
|
||||
- raw:
|
||||
- "[ōô]"
|
||||
- "oo"
|
||||
- raw:
|
||||
- "[īî]"
|
||||
- "ii"
|
||||
|
||||
# youon souken 5-letter
|
||||
- raw:
|
||||
- "cchya"
|
||||
- "っちゃ"
|
||||
- raw:
|
||||
- "cchyu"
|
||||
- "っちゅ"
|
||||
- raw:
|
||||
- "cchuo"
|
||||
- "っちょ"
|
||||
|
||||
# gojuuonzu smol 4-letter
|
||||
- raw:
|
||||
- "[xl]tsu"
|
||||
- "っ"
|
||||
# youon 4-letter
|
||||
- raw:
|
||||
- "chya"
|
||||
- "ちゃ"
|
||||
- raw:
|
||||
- "chyu"
|
||||
- "ちゅ"
|
||||
# gojuuonzu souken 4-letter
|
||||
- raw:
|
||||
- "sshi"
|
||||
- "っし"
|
||||
- raw:
|
||||
- "tchi|cchi"
|
||||
- "っち"
|
||||
- raw:
|
||||
- "ttsu"
|
||||
- "っつ"
|
||||
# youon souken 4-letter
|
||||
- raw:
|
||||
- "kkya"
|
||||
- "っきゃ"
|
||||
- raw:
|
||||
- "kkyu"
|
||||
- "っきゅ"
|
||||
- raw:
|
||||
- "kkyo"
|
||||
- "っきょ"
|
||||
- raw:
|
||||
- "ssha|ssya"
|
||||
- "っしゃ"
|
||||
- raw:
|
||||
- "sshu|ssyu"
|
||||
- "っしゅ"
|
||||
- raw:
|
||||
- "ssho|ssyo"
|
||||
- "っしょ"
|
||||
- raw:
|
||||
- "tcha|ccha|ttya"
|
||||
- "っちゃ"
|
||||
- raw:
|
||||
- "tchu|cchu|ttyu"
|
||||
- "っちゅ"
|
||||
- raw:
|
||||
- "tcho|ccho|ttyo"
|
||||
- "っちょ"
|
||||
# dakuten and handakuten souken 4-letter
|
||||
- raw:
|
||||
- "ggya"
|
||||
- "っぎゃ"
|
||||
- raw:
|
||||
- "ggyu"
|
||||
- "っぎゅ"
|
||||
- raw:
|
||||
- "ggyo"
|
||||
- "っぎょ"
|
||||
- raw:
|
||||
- "bbya"
|
||||
- "っびゃ"
|
||||
- raw:
|
||||
- "bbyu"
|
||||
- "っびゅ"
|
||||
- raw:
|
||||
- "bbyo"
|
||||
- "っびょ"
|
||||
- raw:
|
||||
- "ppya"
|
||||
- "っぴゃ"
|
||||
- raw:
|
||||
- "ppyu"
|
||||
- "っぴゅ"
|
||||
- raw:
|
||||
- "ppyo"
|
||||
- "っぴょ"
|
||||
- raw:
|
||||
- "zzya"
|
||||
- "っじゃ"
|
||||
- raw:
|
||||
- "zzyu"
|
||||
- "っじゅ"
|
||||
- raw:
|
||||
- "zzyo"
|
||||
- "っじょ"
|
||||
- raw:
|
||||
- "ddya"
|
||||
- "っぢゃ"
|
||||
- raw:
|
||||
- "ddyu"
|
||||
- "っぢゅ"
|
||||
- raw:
|
||||
- "ddyo"
|
||||
- "っぢょ"
|
||||
# gojuuonzu 3-letter
|
||||
- raw:
|
||||
- "shi"
|
||||
- "し"
|
||||
- raw:
|
||||
- "chi"
|
||||
- "ち"
|
||||
- raw:
|
||||
- "tsu"
|
||||
- "つ"
|
||||
# youon 3-letter
|
||||
- raw:
|
||||
- "kya"
|
||||
- "きゃ"
|
||||
- raw:
|
||||
- "kyu"
|
||||
- "きゅ"
|
||||
- raw:
|
||||
- "kyo"
|
||||
- "きょ"
|
||||
- raw:
|
||||
- "sha|sya"
|
||||
- "しゃ"
|
||||
- raw:
|
||||
- "shu|syu"
|
||||
- "しゅ"
|
||||
- raw:
|
||||
- "sho|syo"
|
||||
- "しょ"
|
||||
- raw:
|
||||
- "cha|tya"
|
||||
- "ちゃ"
|
||||
- raw:
|
||||
- "chu|tyu"
|
||||
- "ちゅ"
|
||||
- raw:
|
||||
- "cho|tyo"
|
||||
- "ちょ"
|
||||
- raw:
|
||||
- "nya"
|
||||
- "にゃ"
|
||||
- raw:
|
||||
- "nyu"
|
||||
- "にゅ"
|
||||
- raw:
|
||||
- "nyo"
|
||||
- "にょ"
|
||||
- raw:
|
||||
- "hya"
|
||||
- "ひゃ"
|
||||
- raw:
|
||||
- "hyu"
|
||||
- "ひゅ"
|
||||
- raw:
|
||||
- "hyo"
|
||||
- "ひょ"
|
||||
- raw:
|
||||
- "mya"
|
||||
- "みゃ"
|
||||
- raw:
|
||||
- "myu"
|
||||
- "みゅ"
|
||||
- raw:
|
||||
- "myo"
|
||||
- "みょ"
|
||||
- raw:
|
||||
- "rya"
|
||||
- "りゃ"
|
||||
- raw:
|
||||
- "ryu"
|
||||
- "りゅ"
|
||||
- raw:
|
||||
- "ryo"
|
||||
- "りょ"
|
||||
- raw:
|
||||
- "jja"
|
||||
- "っじゃ"
|
||||
- raw:
|
||||
- "jju"
|
||||
- "っじゅ"
|
||||
- raw:
|
||||
- "jjo"
|
||||
- "っじょ"
|
||||
# dakuten and handakuten 3-letter
|
||||
- raw:
|
||||
- "gya"
|
||||
- "ぎゃ"
|
||||
- raw:
|
||||
- "gyu"
|
||||
- "ぎゅ"
|
||||
- raw:
|
||||
- "gyo"
|
||||
- "ぎょ"
|
||||
- raw:
|
||||
- "bya"
|
||||
- "びゃ"
|
||||
- raw:
|
||||
- "byu"
|
||||
- "びゅ"
|
||||
- raw:
|
||||
- "byo"
|
||||
- "びょ"
|
||||
- raw:
|
||||
- "pya"
|
||||
- "ぴゃ"
|
||||
- raw:
|
||||
- "pyu"
|
||||
- "ぴゅ"
|
||||
- raw:
|
||||
- "pyo"
|
||||
- "ぴょ"
|
||||
- raw:
|
||||
- "zya"
|
||||
- "じゃ"
|
||||
- raw:
|
||||
- "zyu"
|
||||
- "じゅ"
|
||||
- raw:
|
||||
- "zyo"
|
||||
- "じょ"
|
||||
- raw:
|
||||
- "dya"
|
||||
- "ぢゃ"
|
||||
- raw:
|
||||
- "dyu"
|
||||
- "ぢゅ"
|
||||
- raw:
|
||||
- "dyo"
|
||||
- "ぢょ"
|
||||
# passport hepburn 3-letter
|
||||
# REMOVED FOR INCOMPATIBILITY CONCERNS
|
||||
# sokuon 3-letter
|
||||
- raw:
|
||||
- "kka"
|
||||
- "っか"
|
||||
- raw:
|
||||
- "kki"
|
||||
- "っき"
|
||||
- raw:
|
||||
- "kku"
|
||||
- "っく"
|
||||
- raw:
|
||||
- "kke"
|
||||
- "っけ"
|
||||
- raw:
|
||||
- "kko"
|
||||
- "っこ"
|
||||
- raw:
|
||||
- "ssa"
|
||||
- "っさ"
|
||||
- raw:
|
||||
- "ssi"
|
||||
- "っし"
|
||||
- raw:
|
||||
- "ssu"
|
||||
- "っす"
|
||||
- raw:
|
||||
- "sse"
|
||||
- "っせ"
|
||||
- raw:
|
||||
- "sso"
|
||||
- "っそ"
|
||||
- raw:
|
||||
- "tta"
|
||||
- "った"
|
||||
- raw:
|
||||
- "tti"
|
||||
- "っち"
|
||||
- raw:
|
||||
- "ttu"
|
||||
- "っつ"
|
||||
- raw:
|
||||
- "tte"
|
||||
- "って"
|
||||
- raw:
|
||||
- "tto"
|
||||
- "っと"
|
||||
- raw:
|
||||
- "hha"
|
||||
- "っは"
|
||||
- raw:
|
||||
- "hhi"
|
||||
- "っひ"
|
||||
- raw:
|
||||
- "ffu"
|
||||
- "っふ"
|
||||
- raw:
|
||||
- "hhe"
|
||||
- "っへ"
|
||||
- raw:
|
||||
- "hho"
|
||||
- "っほ"
|
||||
- raw:
|
||||
- "wwa"
|
||||
- "わ"
|
||||
- raw:
|
||||
- "wwo"
|
||||
- "っを"
|
||||
#dakuon and handakuon souken 3-letters
|
||||
- raw:
|
||||
- "gga"
|
||||
- "っが"
|
||||
- raw:
|
||||
- "ggi"
|
||||
- "っぎ"
|
||||
- raw:
|
||||
- "ggu"
|
||||
- "っぐ"
|
||||
- raw:
|
||||
- "gge"
|
||||
- "っげ"
|
||||
- raw:
|
||||
- "ggo"
|
||||
- "っご"
|
||||
- raw:
|
||||
- "zza"
|
||||
- "っざ"
|
||||
- raw:
|
||||
- "jji"
|
||||
- "っじ"
|
||||
- raw:
|
||||
- "zzu"
|
||||
- "っず"
|
||||
- raw:
|
||||
- "zze"
|
||||
- "っぜ"
|
||||
- raw:
|
||||
- "zzo"
|
||||
- "っぞ"
|
||||
- raw:
|
||||
- "dda"
|
||||
- "っだ"
|
||||
- raw:
|
||||
- "dde"
|
||||
- "っで"
|
||||
- raw:
|
||||
- "ddo"
|
||||
- "っど"
|
||||
- raw:
|
||||
- "bba"
|
||||
- "っば"
|
||||
- raw:
|
||||
- "bbi"
|
||||
- "っび"
|
||||
- raw:
|
||||
- "bbu"
|
||||
- "っぶ"
|
||||
- raw:
|
||||
- "bbe"
|
||||
- "っべ"
|
||||
- raw:
|
||||
- "bbo"
|
||||
- "っぼ"
|
||||
- raw:
|
||||
- "ppa"
|
||||
- "っぱ"
|
||||
- raw:
|
||||
- "ppi"
|
||||
- "っぴ"
|
||||
- raw:
|
||||
- "ppu"
|
||||
- "っぷ"
|
||||
- raw:
|
||||
- "ppe"
|
||||
- "っぺ"
|
||||
- raw:
|
||||
- "ppo"
|
||||
- "っぽ"
|
||||
# gojuuonzu smol 3-letter
|
||||
- raw:
|
||||
- "[xl]ka"
|
||||
- "ヵ"
|
||||
- raw:
|
||||
- "[xl]ke"
|
||||
- "ヶ"
|
||||
- raw:
|
||||
- "[xl]tu"
|
||||
- "っ"
|
||||
- raw:
|
||||
- "[xl]ya"
|
||||
- "ゃ"
|
||||
- raw:
|
||||
- "[xl]yu"
|
||||
- "ゅ"
|
||||
- raw:
|
||||
- "[xl]yo"
|
||||
- "ょ"
|
||||
- raw:
|
||||
- "[xl]wa"
|
||||
- "ゎ"
|
||||
# gojuuonzu 2-letter
|
||||
- raw:
|
||||
- "ka"
|
||||
- "か"
|
||||
- raw:
|
||||
- "ki"
|
||||
- "き"
|
||||
- raw:
|
||||
- "ku"
|
||||
- "く"
|
||||
- raw:
|
||||
- "ke"
|
||||
- "け"
|
||||
- raw:
|
||||
- "ko"
|
||||
- "こ"
|
||||
- raw:
|
||||
- "sa"
|
||||
- "さ"
|
||||
- raw:
|
||||
- "si"
|
||||
- "し"
|
||||
- raw:
|
||||
- "su"
|
||||
- "す"
|
||||
- raw:
|
||||
- "se"
|
||||
- "せ"
|
||||
- raw:
|
||||
- "so"
|
||||
- "そ"
|
||||
- raw:
|
||||
- "ta"
|
||||
- "た"
|
||||
- raw:
|
||||
- "ti"
|
||||
- "ち"
|
||||
- raw:
|
||||
- "tu"
|
||||
- "つ"
|
||||
- raw:
|
||||
- "te"
|
||||
- "て"
|
||||
- raw:
|
||||
- "to"
|
||||
- "と"
|
||||
- raw:
|
||||
- "na"
|
||||
- "な"
|
||||
- raw:
|
||||
- "ni"
|
||||
- "に"
|
||||
- raw:
|
||||
- "nu"
|
||||
- "ぬ"
|
||||
- raw:
|
||||
- "ne"
|
||||
- "ね"
|
||||
- raw:
|
||||
- "no"
|
||||
- "の"
|
||||
- raw:
|
||||
- "ha"
|
||||
- "は"
|
||||
- raw:
|
||||
- "hi"
|
||||
- "ひ"
|
||||
- raw:
|
||||
- "fu|hu"
|
||||
- "ふ"
|
||||
- raw:
|
||||
- "he"
|
||||
- "へ"
|
||||
- raw:
|
||||
- "ho"
|
||||
- "ほ"
|
||||
- raw:
|
||||
- "ma"
|
||||
- "ま"
|
||||
- raw:
|
||||
- "mi"
|
||||
- "み"
|
||||
- raw:
|
||||
- "mu"
|
||||
- "む"
|
||||
- raw:
|
||||
- "me"
|
||||
- "め"
|
||||
- raw:
|
||||
- "mo"
|
||||
- "も"
|
||||
- raw:
|
||||
- "ya"
|
||||
- "や"
|
||||
- raw:
|
||||
- "yu"
|
||||
- "ゆ"
|
||||
- raw:
|
||||
- "yo"
|
||||
- "よ"
|
||||
- raw:
|
||||
- "ra"
|
||||
- "ら"
|
||||
- raw:
|
||||
- "ri"
|
||||
- "り"
|
||||
- raw:
|
||||
- "ru"
|
||||
- "る"
|
||||
- raw:
|
||||
- "re"
|
||||
- "れ"
|
||||
- raw:
|
||||
- "ro"
|
||||
- "ろ"
|
||||
- raw:
|
||||
- "wa"
|
||||
- "わ"
|
||||
- raw:
|
||||
- "wo"
|
||||
- "を"
|
||||
# dakuon and handakuon 2-letter
|
||||
- raw:
|
||||
- "ga"
|
||||
- "が"
|
||||
- raw:
|
||||
- "gi"
|
||||
- "ぎ"
|
||||
- raw:
|
||||
- "gu"
|
||||
- "ぐ"
|
||||
- raw:
|
||||
- "ge"
|
||||
- "げ"
|
||||
- raw:
|
||||
- "go"
|
||||
- "ご"
|
||||
- raw:
|
||||
- "za"
|
||||
- "ざ"
|
||||
- raw:
|
||||
- "ji|zi"
|
||||
- "じ"
|
||||
- raw:
|
||||
- "zu"
|
||||
- "ず"
|
||||
- raw:
|
||||
- "ze"
|
||||
- "ぜ"
|
||||
- raw:
|
||||
- "zo"
|
||||
- "ぞ"
|
||||
- raw:
|
||||
- "da"
|
||||
- "だ"
|
||||
- raw:
|
||||
- "di"
|
||||
- "ぢ"
|
||||
- raw:
|
||||
- "zu|du"
|
||||
- "づ"
|
||||
- raw:
|
||||
- "de"
|
||||
- "で"
|
||||
- raw:
|
||||
- "do"
|
||||
- "ど"
|
||||
- raw:
|
||||
- "ba"
|
||||
- "ば"
|
||||
- raw:
|
||||
- "bi"
|
||||
- "び"
|
||||
- raw:
|
||||
- "bu"
|
||||
- "ぶ"
|
||||
- raw:
|
||||
- "be"
|
||||
- "べ"
|
||||
- raw:
|
||||
- "bo"
|
||||
- "ぼ"
|
||||
- raw:
|
||||
- "pa"
|
||||
- "ぱ"
|
||||
- raw:
|
||||
- "pi"
|
||||
- "ぴ"
|
||||
- raw:
|
||||
- "pu"
|
||||
- "ぷ"
|
||||
- raw:
|
||||
- "pe"
|
||||
- "ぺ"
|
||||
- raw:
|
||||
- "po"
|
||||
- "ぽ"
|
||||
#youon 2-letter
|
||||
- raw:
|
||||
- "ja"
|
||||
- "じゃ"
|
||||
- raw:
|
||||
- "ju"
|
||||
- "じゅ"
|
||||
- raw:
|
||||
- "jo"
|
||||
- "じょ"
|
||||
# ????? 2 - letter
|
||||
- raw:
|
||||
- "wi"
|
||||
- "うぃ"
|
||||
- raw:
|
||||
- "we"
|
||||
- "うぇ"
|
||||
# gojuuonzu smol 2-letter
|
||||
- raw:
|
||||
- "[xl]a"
|
||||
- "ぁ"
|
||||
- raw:
|
||||
- "[xl]i"
|
||||
- "ぃ"
|
||||
- raw:
|
||||
- "[xl]u"
|
||||
- "ぅ"
|
||||
- raw:
|
||||
- "[xl]e"
|
||||
- "ぇ"
|
||||
- raw:
|
||||
- "[xl]o"
|
||||
- "ぉ"
|
||||
- raw:
|
||||
- "[xl]n"
|
||||
- "ん"
|
||||
# gojuuonzu 1-letter
|
||||
- raw:
|
||||
- "a"
|
||||
- "あ"
|
||||
- raw:
|
||||
- "i"
|
||||
- "い"
|
||||
- raw:
|
||||
- "u"
|
||||
- "う"
|
||||
- raw:
|
||||
- "e"
|
||||
- "え"
|
||||
- raw:
|
||||
- "o"
|
||||
- "お"
|
||||
- raw:
|
||||
- "n"
|
||||
- "ん"
|
359
x2i/dictionaries/i-keys.yaml
Normal file
359
x2i/dictionaries/i-keys.yaml
Normal file
@ -0,0 +1,359 @@
|
||||
---
|
||||
- raw:
|
||||
- "[nN][n][g][iI][iI]"
|
||||
- "ᙲ"
|
||||
- raw:
|
||||
- "[nN][n][g][uU][uU]"
|
||||
- "ᙴ"
|
||||
- raw:
|
||||
- "[nN][n][g][aA][aA]"
|
||||
- "ᙶ"
|
||||
|
||||
- raw:
|
||||
- "[nN][gG][iI][iI]"
|
||||
- "ᖐ"
|
||||
- raw:
|
||||
- "[nN][gG][uU][uU]"
|
||||
- "ᖒ"
|
||||
- raw:
|
||||
- "[nN][gG][aA][aA]"
|
||||
- "ᖔ"
|
||||
- raw:
|
||||
- "[nN][n][g][iI]"
|
||||
- "ᙱ"
|
||||
- raw:
|
||||
- "[nN][n][g][uU]"
|
||||
- "ᙳ"
|
||||
- raw:
|
||||
- "[nN][n][g][aA]"
|
||||
- "ᙵ"
|
||||
- raw:
|
||||
- "[qQ][qQ][iI][iI]"
|
||||
- "ᖅᑮ"
|
||||
- raw:
|
||||
- "[qQ][qQ][uU][uU]"
|
||||
- "ᖅᑰ"
|
||||
- raw:
|
||||
- "[qQ][qQ][aA][aA]"
|
||||
- "ᖅᑳ"
|
||||
|
||||
- raw:
|
||||
- "[nN][n][g]"
|
||||
- "ᖖ"
|
||||
- raw:
|
||||
- "[pP][iI][iI]"
|
||||
- "ᐲ"
|
||||
- raw:
|
||||
- "[pP][uU][uU]"
|
||||
- "ᐴ"
|
||||
- raw:
|
||||
- "[pP][aA][aA]"
|
||||
- "ᐹ"
|
||||
- raw:
|
||||
- "[tT][iI][iI]"
|
||||
- "ᑏ"
|
||||
- raw:
|
||||
- "[tT][uU][uU]"
|
||||
- "ᑑ"
|
||||
- raw:
|
||||
- "[tT][aA][aA]"
|
||||
- "ᑖ"
|
||||
- raw:
|
||||
- "[kK][iI][iI]"
|
||||
- "ᑮ"
|
||||
- raw:
|
||||
- "[kK][uU][uU]"
|
||||
- "ᑰ"
|
||||
- raw:
|
||||
- "[kK][aA][aA]"
|
||||
- "ᑳ"
|
||||
- raw:
|
||||
- "[gG][iI][iI]"
|
||||
- "ᒌ"
|
||||
- raw:
|
||||
- "[gG][uU][uU]"
|
||||
- "ᒎ"
|
||||
- raw:
|
||||
- "[gG][aA][aA]"
|
||||
- "ᒑ"
|
||||
- raw:
|
||||
- "[mM][iI][iI]"
|
||||
- "ᒦ"
|
||||
- raw:
|
||||
- "[mM][uU][uU]"
|
||||
- "ᒨ"
|
||||
- raw:
|
||||
- "[mM][aA][aA]"
|
||||
- "ᒫ"
|
||||
- raw:
|
||||
- "[nN][iI][iI]"
|
||||
- "ᓃ"
|
||||
- raw:
|
||||
- "[nN][uU][uU]"
|
||||
- "ᓅ"
|
||||
- raw:
|
||||
- "[nN][aA][aA]"
|
||||
- "ᓈ"
|
||||
- raw:
|
||||
- "[nN][gG][iI]"
|
||||
- "ᖏ"
|
||||
- raw:
|
||||
- "[nN][gG][uU]"
|
||||
- "ᖑ"
|
||||
- raw:
|
||||
- "[nN][gG][aA]"
|
||||
- "ᖓ"
|
||||
- raw:
|
||||
- "[sS][iI][iI]"
|
||||
- "ᓰ"
|
||||
- raw:
|
||||
- "[sS][uU][uU]"
|
||||
- "ᓲ"
|
||||
- raw:
|
||||
- "[sS][aA][aA]"
|
||||
- "ᓵ"
|
||||
- raw:
|
||||
- "[lL][iI][iI]"
|
||||
- "ᓖ"
|
||||
- raw:
|
||||
- "[lL][uU][uU]"
|
||||
- "ᓘ"
|
||||
- raw:
|
||||
- "[lL][aA][aA]"
|
||||
- "ᓛ"
|
||||
- raw:
|
||||
- "[jJyY][iI][iI]"
|
||||
- "ᔩ"
|
||||
- raw:
|
||||
- "[jJyY][uU][uU]"
|
||||
- "ᔫ"
|
||||
- raw:
|
||||
- "[jJyY][aA][aA]"
|
||||
- "ᔮ"
|
||||
- raw:
|
||||
- "[vV][iI][iI]"
|
||||
- "ᕖ"
|
||||
- raw:
|
||||
- "[vV][uU][uU]"
|
||||
- "ᕘ"
|
||||
- raw:
|
||||
- "[vV][aA][aA]"
|
||||
- "ᕚ"
|
||||
- raw:
|
||||
- "[rR][iI][iI]"
|
||||
- "ᕇ"
|
||||
- raw:
|
||||
- "[rR][uU][uU]"
|
||||
- "ᕉ"
|
||||
- raw:
|
||||
- "[rR][aA][aA]"
|
||||
- "ᕌ"
|
||||
- raw:
|
||||
- "[qQ][iI][iI]"
|
||||
- "ᖀ"
|
||||
- raw:
|
||||
- "[qQ][uU][uU]"
|
||||
- "ᖂ"
|
||||
- raw:
|
||||
- "[qQ][aA][aA]"
|
||||
- "ᖄ"
|
||||
- raw:
|
||||
- "[qQ][qQ][iI]"
|
||||
- "ᖅᑭ"
|
||||
- raw:
|
||||
- "[qQ][qQ][uU]"
|
||||
- "ᖅᑯ"
|
||||
- raw:
|
||||
- "[qQ][aA][aA]"
|
||||
- "ᖅᑲ"
|
||||
- raw:
|
||||
- "[łŁ&][iI][iI]"
|
||||
- "ᖡ"
|
||||
- raw:
|
||||
- "[łŁ&][uU][uU]"
|
||||
- "ᖣ"
|
||||
- raw:
|
||||
- "[łŁ&][aA][aA]"
|
||||
- "ᖥ"
|
||||
|
||||
- raw:
|
||||
- "[iI][iI]"
|
||||
- "ᐄ"
|
||||
- raw:
|
||||
- "[uU][uU]"
|
||||
- "ᐆ"
|
||||
- raw:
|
||||
- "[aA][aA]"
|
||||
- "ᐋ"
|
||||
- raw:
|
||||
- "[pP][iI]"
|
||||
- "ᐱ"
|
||||
- raw:
|
||||
- "[pP][uU]"
|
||||
- "ᐳ"
|
||||
- raw:
|
||||
- "[pP][aA]"
|
||||
- "ᐸ"
|
||||
- raw:
|
||||
- "[tT][iI]"
|
||||
- "ᑎ"
|
||||
- raw:
|
||||
- "[tT][uU]"
|
||||
- "ᑐ"
|
||||
- raw:
|
||||
- "[tT][aA]"
|
||||
- "ᑕ"
|
||||
- raw:
|
||||
- "[kK][iI]"
|
||||
- "ᑭ"
|
||||
- raw:
|
||||
- "[kK][uU]"
|
||||
- "ᑯ"
|
||||
- raw:
|
||||
- "[kK][aA]"
|
||||
- "ᑲ"
|
||||
- raw:
|
||||
- "[gG][iI]"
|
||||
- "ᒋ"
|
||||
- raw:
|
||||
- "[gG][uU]"
|
||||
- "ᒍ"
|
||||
- raw:
|
||||
- "[gG][aA]"
|
||||
- "ᒐ"
|
||||
- raw:
|
||||
- "[mM][iI]"
|
||||
- "ᒥ"
|
||||
- raw:
|
||||
- "[mM][uU]"
|
||||
- "ᒧ"
|
||||
- raw:
|
||||
- "[mM][aA]"
|
||||
- "ᒪ"
|
||||
- raw:
|
||||
- "[nN][iI]"
|
||||
- "ᓂ"
|
||||
- raw:
|
||||
- "[nN][uU]"
|
||||
- "ᓄ"
|
||||
- raw:
|
||||
- "[nN][aA]"
|
||||
- "ᓇ"
|
||||
- raw:
|
||||
- "[nN][gG]"
|
||||
- "ᖕ"
|
||||
- raw:
|
||||
- "[sS][iI]"
|
||||
- "ᓯ"
|
||||
- raw:
|
||||
- "[sS][uU]"
|
||||
- "ᓱ"
|
||||
- raw:
|
||||
- "[sS][aA]"
|
||||
- "ᓴ"
|
||||
- raw:
|
||||
- "[lL][iI]"
|
||||
- "ᓕ"
|
||||
- raw:
|
||||
- "[lL][uU]"
|
||||
- "ᓗ"
|
||||
- raw:
|
||||
- "[lL][aA]"
|
||||
- "ᓚ"
|
||||
- raw:
|
||||
- "[jJyY][iI]"
|
||||
- "ᔨ"
|
||||
- raw:
|
||||
- "[jJyY][uU]"
|
||||
- "ᔪ"
|
||||
- raw:
|
||||
- "[jJyY][aA]"
|
||||
- "ᔭ"
|
||||
- raw:
|
||||
- "[vV][iI]"
|
||||
- "ᕕ"
|
||||
- raw:
|
||||
- "[vV][uU]"
|
||||
- "ᕗ"
|
||||
- raw:
|
||||
- "[vV][aA]"
|
||||
- "ᕙ"
|
||||
- raw:
|
||||
- "[rR][iI]"
|
||||
- "ᕆ"
|
||||
- raw:
|
||||
- "[rR][uU]"
|
||||
- "ᕈ"
|
||||
- raw:
|
||||
- "[rR][aA]"
|
||||
- "ᕋ"
|
||||
- raw:
|
||||
- "[qQ][iI]"
|
||||
- "ᕿ"
|
||||
- raw:
|
||||
- "[qQ][uU]"
|
||||
- "ᖁ"
|
||||
- raw:
|
||||
- "[qQ][aA]"
|
||||
- "ᖃ"
|
||||
- raw:
|
||||
- "[łŁ&][iI]"
|
||||
- "ᖠ"
|
||||
- raw:
|
||||
- "[łŁ&][uU]"
|
||||
- "ᖢ"
|
||||
- raw:
|
||||
- "[łŁ&][aA]"
|
||||
- "ᖤ"
|
||||
|
||||
- raw:
|
||||
- "[iI]"
|
||||
- "ᐃ"
|
||||
- raw:
|
||||
- "[uU]"
|
||||
- "ᐅ"
|
||||
- raw:
|
||||
- "[aA]"
|
||||
- "ᐊ"
|
||||
- raw:
|
||||
- "[pP]"
|
||||
- "ᑉ"
|
||||
- raw:
|
||||
- "[pP]"
|
||||
- "ᑉ"
|
||||
- raw:
|
||||
- "[tT]"
|
||||
- "ᑦ"
|
||||
- raw:
|
||||
- "[kK]"
|
||||
- "ᒃ"
|
||||
- raw:
|
||||
- "[gG]"
|
||||
- "ᒡ"
|
||||
- raw:
|
||||
- "[mM]"
|
||||
- "ᒻ"
|
||||
- raw:
|
||||
- "[nN]"
|
||||
- "ᓐ"
|
||||
- raw:
|
||||
- "[sS]"
|
||||
- "ᔅ"
|
||||
- raw:
|
||||
- "[lL]"
|
||||
- "ᓪ"
|
||||
- raw:
|
||||
- "[jJyY]"
|
||||
- "ᔾ"
|
||||
- raw:
|
||||
- "[vV]"
|
||||
- "ᕝ"
|
||||
- raw:
|
||||
- "[rR]"
|
||||
- "ᕐ"
|
||||
- raw:
|
||||
- "[qQ]"
|
||||
- "ᖅ"
|
||||
- raw:
|
||||
- "[łŁ&]"
|
||||
- "ᖦ"
|
39
x2i/dictionaries/ik-keys.yaml
Normal file
39
x2i/dictionaries/ik-keys.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
- - l^%
|
||||
- ł̣
|
||||
- - l%^
|
||||
- ł̣
|
||||
- - L^%
|
||||
- Ł̣
|
||||
- - L%^
|
||||
- Ł̣
|
||||
|
||||
- - g^
|
||||
- ġ
|
||||
- - G^
|
||||
- Ġ
|
||||
- - l^
|
||||
- ḷ
|
||||
- - l%
|
||||
- ł
|
||||
- - L^
|
||||
- Ḷ
|
||||
- - L%
|
||||
- Ł
|
||||
- - '&^'
|
||||
- ł̣
|
||||
- - N%
|
||||
- Ñ
|
||||
- - N^
|
||||
- Ŋ
|
||||
- - n%
|
||||
- ñ
|
||||
- - n^
|
||||
- ŋ
|
||||
- - r^
|
||||
- ȓ
|
||||
- - R^
|
||||
- Ȓ
|
||||
|
||||
- - '&'
|
||||
- ł
|
273
x2i/dictionaries/nav.ts
Normal file
273
x2i/dictionaries/nav.ts
Normal file
@ -0,0 +1,273 @@
|
||||
export function convert(input: string)
|
||||
{
|
||||
var c=" ";
|
||||
var rom=input+" ";
|
||||
var flag=0;
|
||||
while(rom.length > 1) {
|
||||
if(rom[1]=='^') {
|
||||
if(rom.length>=2 && rom[2]=='@') {
|
||||
if(rom[0]=='a') {
|
||||
c=c+'ą́';
|
||||
flag=1;
|
||||
}
|
||||
else if(rom[0]=='A') {
|
||||
c=c+'Ą́';
|
||||
flag=1;
|
||||
}
|
||||
else if(rom[0]=='e') {
|
||||
c=c+'ę́';
|
||||
flag=1;
|
||||
}
|
||||
else if(rom[0]=='E') {
|
||||
c=c+'Ę́';
|
||||
flag=1;
|
||||
}
|
||||
else if(rom[0]=='i') {
|
||||
c=c+'į́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='I') {
|
||||
c=c+'Į́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='o') {
|
||||
c=c+'ǫ́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='O') {
|
||||
c=c+'Ǫ́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='u') {
|
||||
c=c+'ų́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='U') {
|
||||
c=c+'Ų́'
|
||||
flag=1
|
||||
}
|
||||
if(flag) {
|
||||
rom=rom.slice(3)
|
||||
flag=0
|
||||
continue
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(rom[0]=='a') {
|
||||
c=c+'á'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='A') {
|
||||
c=c+'Á'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='e') {
|
||||
c=c+'é'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='E') {
|
||||
c=c+'É'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='i') {
|
||||
c=c+'í'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='I') {
|
||||
c=c+'Í'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='o') {
|
||||
c=c+'ó'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='O') {
|
||||
c=c+'Ó'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='u') {
|
||||
c=c+'ú'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='U') {
|
||||
c=c+'Ú'
|
||||
flag=1
|
||||
}
|
||||
if(flag) {
|
||||
rom=rom.slice(2)
|
||||
flag=0
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rom[1]=='@') {
|
||||
if(rom.length>=2 && rom[2]=='^') {
|
||||
if(rom[0]=='a') {
|
||||
c=c+'ą́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='A') {
|
||||
c=c+'Ą́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='e') {
|
||||
c=c+'ę́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='E') {
|
||||
c=c+'Ę́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='i') {
|
||||
c=c+'į́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='I') {
|
||||
c=c+'Į́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='o') {
|
||||
c=c+'ǫ́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='O') {
|
||||
c=c+'Ǫ́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='u') {
|
||||
c=c+'ų́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='U') {
|
||||
c=c+'Ų́'
|
||||
flag=1
|
||||
}
|
||||
if(flag) {
|
||||
rom=rom.slice(3)
|
||||
flag=0
|
||||
continue
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(rom[0]=='a') {
|
||||
c=c+'ą'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='A') {
|
||||
c=c+'Ą'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='e') {
|
||||
c=c+'ę'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='E') {
|
||||
c=c+'Ę'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='i') {
|
||||
c=c+'į'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='I') {
|
||||
c=c+'Į'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='o') {
|
||||
c=c+'ǫ'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='O') {
|
||||
c=c+'Ǫ'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='u') {
|
||||
c=c+'ų'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='U') {
|
||||
c=c+'Ų'
|
||||
flag=1
|
||||
}
|
||||
if(flag) {
|
||||
rom=rom.slice(2)
|
||||
flag=0
|
||||
continue
|
||||
}
|
||||
}
|
||||
}
|
||||
if(rom[1]=='%') {
|
||||
if(rom[0]=='a') {
|
||||
c=c+'ą́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='A') {
|
||||
c=c+'Ą́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='e') {
|
||||
c=c+'ę́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='E') {
|
||||
c=c+'Ę́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='i') {
|
||||
c=c+'į́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='I') {
|
||||
c=c+'Į́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='o') {
|
||||
c=c+'ǫ́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='O') {
|
||||
c=c+'Ǫ́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='u') {
|
||||
c=c+'ų́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='U') {
|
||||
c=c+'Ų́'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='l') {
|
||||
c=c+'ł'
|
||||
flag=1
|
||||
}
|
||||
else if(rom[0]=='L') {
|
||||
c=c+'Ł'
|
||||
flag=1
|
||||
}
|
||||
if(flag) {
|
||||
rom=rom.slice(2)
|
||||
flag=0
|
||||
continue
|
||||
}
|
||||
}
|
||||
if(rom[0]=="'") {
|
||||
if(rom[1]!='^') {
|
||||
c=c+'’'
|
||||
rom=rom.slice(1)
|
||||
continue
|
||||
}
|
||||
if(rom[1]=='^') {
|
||||
c=c+'\''
|
||||
rom=rom.slice(2)
|
||||
continue
|
||||
}
|
||||
}
|
||||
if(rom[0]=='#') {
|
||||
break
|
||||
}
|
||||
c=c+rom[0]
|
||||
rom=rom.slice(1)
|
||||
}
|
||||
return c;
|
||||
}
|
101
x2i/index.js
101
x2i/index.js
@ -1,101 +0,0 @@
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var fs = require("fs");
|
||||
var yaml = require("js-yaml");
|
||||
var OuterXRegExp = require("xregexp");
|
||||
var regex = OuterXRegExp("(?:(^|[`\\p{White_Space}])) # must be preceded by whitespace or surrounded by code brackets\n ([A-Za-z]*) # key, to lower (2)\n ([/[]) # bracket left (3)\n (\\S|\\S.*?\\S) # body (4)\n ([/\\]]) # bracket right (5)\n (?=$|[`\\p{White_Space}\\pP]) # must be followed by a white space or punctuation", "gmx");
|
||||
var defaultMatchAction = function (left, match, right) { return left + match + right; };
|
||||
var matchType = {
|
||||
p: {
|
||||
join: function (_, match) { return "*" + match; },
|
||||
keys: readKeys("./x2i/apie-keys.yaml")
|
||||
},
|
||||
x: {
|
||||
keys: readKeys("./x2i/x2i-keys.yaml")
|
||||
},
|
||||
z: {
|
||||
keys: readKeys("./x2i/z2i-keys.yaml")
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Read translation keys from file. Escapes strings first.
|
||||
*
|
||||
* @param fpath File to key definitions. (yaml, utf8)
|
||||
* @returns Compiled keys.
|
||||
*/
|
||||
function readKeys(fpath) {
|
||||
return yaml
|
||||
.safeLoad(fs.readFileSync(fpath, "utf8"))
|
||||
.map(compileKey)
|
||||
.filter(Boolean);
|
||||
}
|
||||
/**
|
||||
* Compiles a plain object into a regexp thing.
|
||||
*
|
||||
* @param entry Regex and replacement pair, or delimited match object.
|
||||
*/
|
||||
function compileKey(entry) {
|
||||
if (Array.isArray(entry)) {
|
||||
var key = entry[0], val = entry[1];
|
||||
return [OuterXRegExp(OuterXRegExp.escape(key)), val, "all"];
|
||||
}
|
||||
// don't escape key
|
||||
if ("raw" in entry) {
|
||||
var _a = entry.raw, key = _a[0], val = _a[1];
|
||||
return [OuterXRegExp(key), val, "all"];
|
||||
}
|
||||
// is a dict
|
||||
try {
|
||||
var _b = entry.delimiters, left = _b[0], right = _b[1], translations_1 = entry.translations;
|
||||
return [
|
||||
OuterXRegExp(OuterXRegExp.escape(left) + "(?<inside>.*?)" + OuterXRegExp.escape(right)),
|
||||
function (m) { return OuterXRegExp.replaceEach(m.inside, translations_1.map(compileKey)); },
|
||||
"all"
|
||||
];
|
||||
}
|
||||
catch (e) {
|
||||
console.log(entry + " is not an array or a proper object, ignoring");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Convert four-tuple of Strings into a specified "official" representation
|
||||
*
|
||||
* @param key What kind of conversion key is appropriate
|
||||
* @param left Left bracket
|
||||
* @param match Body
|
||||
* @param right Right bracket
|
||||
* @returns Converted item, if any.
|
||||
*/
|
||||
function force(key, left, match, right) {
|
||||
var lowerKey = key.toLowerCase();
|
||||
if (!(lowerKey in matchType))
|
||||
return;
|
||||
var _a = matchType[lowerKey], keys = _a.keys, join = _a.join;
|
||||
if (keys) {
|
||||
var action = join || defaultMatchAction;
|
||||
// need to use `as (RegExp | string)[][]` because the provided typings are too generic
|
||||
return action(left, OuterXRegExp.replaceEach(match, keys), right);
|
||||
}
|
||||
}
|
||||
exports.force = force;
|
||||
/**
|
||||
* Grab all x2i strings in message string.
|
||||
*
|
||||
* @param content Full message that may or may not contain x2i strings
|
||||
* @returns Converted representations
|
||||
*/
|
||||
function x2i(content) {
|
||||
var results = [];
|
||||
OuterXRegExp.forEach(content, regex, function (match) {
|
||||
var parts = match.slice(2, 6);
|
||||
if (parts.length === 4) {
|
||||
var k = parts[0], l = parts[1], m = parts[2], r = parts[3];
|
||||
var converted = force(k, l, m, r); // eg x, [, text, ]
|
||||
if (converted) {
|
||||
results.push(converted);
|
||||
}
|
||||
}
|
||||
});
|
||||
return results.join(" ");
|
||||
}
|
||||
exports["default"] = x2i;
|
46
x2i/index.ts
46
x2i/index.ts
@ -21,8 +21,9 @@ type CompiledReplacer = [
|
||||
];
|
||||
|
||||
interface IMatchInstructions {
|
||||
keys: CompiledReplacer[];
|
||||
keys?: CompiledReplacer[];
|
||||
join?(left: string, match: string, right: string): string;
|
||||
matchFunction?: Function;
|
||||
}
|
||||
|
||||
const regex = OuterXRegExp(
|
||||
@ -35,17 +36,41 @@ const regex = OuterXRegExp(
|
||||
"gmx");
|
||||
|
||||
const defaultMatchAction = (left: string, match: string, right: string) => left + match + right;
|
||||
const defaultMatchFunction = (match: string, keys: ([RegExp, string | ((m: {[key: string]: string;}) => string), string][])) => OuterXRegExp.replaceEach(match, keys as (RegExp | string)[][])
|
||||
|
||||
import * as chr from "./dictionaries/chr";
|
||||
import * as nav from "./dictionaries/nav";
|
||||
|
||||
const matchType: { [key: string]: IMatchInstructions } = {
|
||||
chr: {
|
||||
join: (_, match) => `- ${match}`,
|
||||
matchFunction: chr.convert,
|
||||
},
|
||||
nav: {
|
||||
join: (_, match) => `- ${match}`,
|
||||
matchFunction: nav.convert,
|
||||
},
|
||||
ik: {
|
||||
join: (_, match) => `- ${match}`,
|
||||
keys: readKeys("./x2i/dictionaries/ik-keys.yaml"),
|
||||
},
|
||||
p: {
|
||||
join: (_, match) => `*${match}`,
|
||||
keys: readKeys("./x2i/apie-keys.yaml"),
|
||||
keys: readKeys("./x2i/dictionaries/apie-keys.yaml"),
|
||||
},
|
||||
x: {
|
||||
keys: readKeys("./x2i/x2i-keys.yaml"),
|
||||
keys: readKeys("./x2i/dictionaries/x2i-keys.yaml"),
|
||||
},
|
||||
z: {
|
||||
keys: readKeys("./x2i/z2i-keys.yaml"),
|
||||
keys: readKeys("./x2i/dictionaries/z2i-keys.yaml"),
|
||||
},
|
||||
i: {
|
||||
join: (_, match) => `- ${match}`,
|
||||
keys: readKeys("./x2i/dictionaries/i-keys.yaml"),
|
||||
},
|
||||
hi: {
|
||||
join: (_, match) => `- ${match}`,
|
||||
keys: readKeys("./x2i/dictionaries/hi-keys.yaml"),
|
||||
},
|
||||
};
|
||||
|
||||
@ -56,8 +81,9 @@ const matchType: { [key: string]: IMatchInstructions } = {
|
||||
* @returns Compiled keys.
|
||||
*/
|
||||
function readKeys(fpath: string) {
|
||||
return yaml
|
||||
var keys: any = yaml
|
||||
.safeLoad(fs.readFileSync(fpath, "utf8"))
|
||||
return keys
|
||||
.map(compileKey)
|
||||
.filter(Boolean) as CompiledReplacer[];
|
||||
}
|
||||
@ -111,11 +137,12 @@ export function force(key: string, left: string, match: string, right: string) {
|
||||
const lowerKey = key.toLowerCase();
|
||||
if (!(lowerKey in matchType)) return;
|
||||
|
||||
const { keys, join } = matchType[lowerKey];
|
||||
if (keys) {
|
||||
const { keys, join, matchFunction } = matchType[lowerKey];
|
||||
if (keys || matchFunction) {
|
||||
const action = join || defaultMatchAction;
|
||||
const doFunction = matchFunction || defaultMatchFunction;
|
||||
// need to use `as (RegExp | string)[][]` because the provided typings are too generic
|
||||
return action(left, OuterXRegExp.replaceEach(match, keys as (RegExp | string)[][]), right);
|
||||
return action(left, doFunction(match, keys), right);
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,7 +157,8 @@ export default function x2i(content: string) {
|
||||
OuterXRegExp.forEach(content, regex, match => {
|
||||
const parts = match.slice(2, 6);
|
||||
if (parts.length === 4) {
|
||||
const [k, l, m, r] = parts;
|
||||
var [k, l, m, r] = parts;
|
||||
if (k === "hi") { m = m.replace(/\s/g, '').toLowerCase() }
|
||||
const converted = force(k, l, m, r); // eg x, [, text, ]
|
||||
|
||||
if (converted) {
|
||||
|
Loading…
Reference in New Issue
Block a user