Compare commits
21 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 |
12
README.md
12
README.md
@ -10,14 +10,8 @@ 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.
|
||||
|
||||
@ -45,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
|
||||
|
10
index.ts
10
index.ts
@ -1,4 +1,4 @@
|
||||
const version = "2.3.1";
|
||||
const version = "2.4.4";
|
||||
import x2i from "./x2i";
|
||||
import { existsSync } from "fs";
|
||||
|
||||
@ -24,6 +24,7 @@ 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;};
|
||||
@ -46,12 +47,13 @@ function help(roomId) {
|
||||
To use me, type a key together with either / or [] as delimeters
|
||||
|
||||
x - X-SAMPA - https://en.wikipedia.org/wiki/X-SAMPA
|
||||
z - Z-SAMPA - http://www.kneequickie.com/kq/Z-SAMPA
|
||||
p - Proto-Indo-European Notation (see !xpie)
|
||||
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
|
||||
|
||||
@ -72,7 +74,7 @@ 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://github.com/dali99/matrix-wug/blob/master/x2i/apie-keys.yaml)
|
||||
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`;
|
||||
|
||||
|
1357
package-lock.json
generated
1357
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,14 +1,15 @@
|
||||
{
|
||||
"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": {
|
||||
"build": "tsc",
|
||||
"start": "node build/index.js"
|
||||
},
|
||||
"author": "Daniel",
|
||||
"license": "ISC",
|
||||
"license": "AGPL3",
|
||||
"dependencies": {
|
||||
"matrix-bot-sdk": "^0.3.2",
|
||||
"@types/js-yaml": "^3.12.1",
|
||||
|
@ -1,7 +1,7 @@
|
||||
with import <nixpkgs> {};
|
||||
stdenv.mkDerivation {
|
||||
name = "node";
|
||||
buildInputs = [ nodejs-10_x ];
|
||||
buildInputs = [ nodejs-10_x yarn ];
|
||||
shellHook = ''
|
||||
export PATH="$PWD/node_modules/.bin/:$PATH"
|
||||
'';
|
||||
|
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"
|
||||
- "ん"
|
10
x2i/index.ts
10
x2i/index.ts
@ -68,6 +68,10 @@ const matchType: { [key: string]: IMatchInstructions } = {
|
||||
join: (_, match) => `- ${match}`,
|
||||
keys: readKeys("./x2i/dictionaries/i-keys.yaml"),
|
||||
},
|
||||
hi: {
|
||||
join: (_, match) => `- ${match}`,
|
||||
keys: readKeys("./x2i/dictionaries/hi-keys.yaml"),
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
@ -77,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[];
|
||||
}
|
||||
@ -152,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