From 2f999368a3ae1244ea3b528466dbcb6b5f4b91c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Thu, 28 Feb 2019 14:24:44 +0100 Subject: [PATCH 1/3] Update readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 2fde7d0..de46732 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ For the PIE notation: * 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. This is best learned by experimenting. + Inuktitut Syllabics: https://en.wikipedia.org/wiki/Inuktitut_syllabics 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. From 7c7f7bff0fbe22063f52f539a900d170b3f947aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Fri, 1 Mar 2019 01:31:30 +0100 Subject: [PATCH 2/3] Don't use // and [] in the output for i// --- index.ts | 7 ++----- x2i/index.ts | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index eb90246..6b2889b 100644 --- a/index.ts +++ b/index.ts @@ -1,16 +1,13 @@ -const version = "2.0.1"; +const version = "2.0.2"; 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); diff --git a/x2i/index.ts b/x2i/index.ts index 580e9ee..dbb41ca 100644 --- a/x2i/index.ts +++ b/x2i/index.ts @@ -48,6 +48,7 @@ const matchType: { [key: string]: IMatchInstructions } = { keys: readKeys("./x2i/z2i-keys.yaml"), }, i: { + join: (_, match) => `|${match}|`, keys: readKeys("./x2i/i-keys.yaml"), }, }; From 388871958d17b53ce8df66c1f515e135a615e08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Fri, 1 Mar 2019 02:45:09 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Add=20I=C3=B1upiatun=20Orthography?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ index.ts | 41 +++++++++++++++++++++++++++++++++++++---- x2i/ik-keys.yaml | 39 +++++++++++++++++++++++++++++++++++++++ x2i/index.ts | 6 +++++- 4 files changed, 87 insertions(+), 5 deletions(-) create mode 100644 x2i/ik-keys.yaml diff --git a/README.md b/README.md index de46732..ff62612 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,12 @@ This is best learned by experimenting. 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! diff --git a/index.ts b/index.ts index 6b2889b..f4e7014 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,4 @@ -const version = "2.0.2"; +const version = "2.1.1"; import x2i from "./x2i"; import { existsSync } from "fs"; @@ -26,6 +26,8 @@ async function handle(roomId, event) { if (event.sender === await myself) { console.log("Wait a minute... That's me!"); 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 === "!pie") {xpie(roomId); return;}; if (event.content.body === "!xdebug") {debug(roomId); return;}; console.log("Trying to convert the message!"); @@ -38,17 +40,48 @@ 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 + var message = `Hi I can help you translate X-SAMPA, Z-SAMPA to IPA! +Use (x/z/p/i/ik) together with either / or [] as delimeters x/"hEloU/ z[or\` 5aIk DIz] p/mreghnom/ 😀 -I also can transcribe to Inuktitut Syllabics like this: i[tusaumaqattautijjutinik aulattijiit]. +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) +i - Inuktitut Syllabics | https://en.wikipedia.org/wiki/Inuktitut_syllabics +ik - Iñupiatun Orthography (see !xik) Find my source at https://github.com/Dali99/matrix-wug`; 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://github.com/dali99/matrix-wug/blob/master/x2i/apie-keys.yaml) + +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); +} + 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}`; diff --git a/x2i/ik-keys.yaml b/x2i/ik-keys.yaml new file mode 100644 index 0000000..70d078d --- /dev/null +++ b/x2i/ik-keys.yaml @@ -0,0 +1,39 @@ +--- +- - l^% + - ł̣ +- - l%^ + - ł̣ +- - L^% + - Ł̣ +- - L%^ + - Ł̣ + +- - g^ + - ġ +- - G^ + - Ġ +- - l^ + - ḷ +- - l% + - ł +- - L^ + - Ḷ +- - L% + - Ł +- - '&^' + - ł̣ +- - N% + - Ñ +- - N^ + - Ŋ +- - n% + - ñ +- - n^ + - ŋ +- - r^ + - ȓ +- - R^ + - Ȓ + +- - '&' + - ł \ No newline at end of file diff --git a/x2i/index.ts b/x2i/index.ts index dbb41ca..197ec03 100644 --- a/x2i/index.ts +++ b/x2i/index.ts @@ -37,6 +37,10 @@ const regex = OuterXRegExp( const defaultMatchAction = (left: string, match: string, right: string) => left + match + right; const matchType: { [key: string]: IMatchInstructions } = { + ik: { + join: (_, match) => `- ${match}`, + keys: readKeys("./x2i/ik-keys.yaml"), + }, p: { join: (_, match) => `*${match}`, keys: readKeys("./x2i/apie-keys.yaml"), @@ -48,7 +52,7 @@ const matchType: { [key: string]: IMatchInstructions } = { keys: readKeys("./x2i/z2i-keys.yaml"), }, i: { - join: (_, match) => `|${match}|`, + join: (_, match) => `- ${match}`, keys: readKeys("./x2i/i-keys.yaml"), }, };