From bb4b7a653493b7a352671d326161e771c3ec5629 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Thu, 14 Mar 2019 23:32:30 +0100 Subject: [PATCH] allow usage of ' for . in cherokee --- index.ts | 4 ++-- x2i/dictionaries/chr.ts | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.ts b/index.ts index 9e6c9a8..d4c78bc 100644 --- a/index.ts +++ b/index.ts @@ -1,4 +1,4 @@ -const version = "2.2.0"; +const version = "2.2.1"; import x2i from "./x2i"; import { existsSync } from "fs"; @@ -91,7 +91,7 @@ Thanks to Tuugaalikkuluk for the encoding`; 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 (.) +Write the wanted syllables down, but separate them by a dot (.) or an apostrophe (') Thanks to Tuugaalikkuluk for the encoding diff --git a/x2i/dictionaries/chr.ts b/x2i/dictionaries/chr.ts index 4f873b3..6db143e 100644 --- a/x2i/dictionaries/chr.ts +++ b/x2i/dictionaries/chr.ts @@ -23,37 +23,37 @@ export function convert(input: string) else if (i==1) { if (rom[0].toLowerCase()=='a') { c=c+'Ꭰ'; - if(rom[1]=="."&& isAlpha(rom[2])) rom=rom.slice(2) + 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]=="."&& isAlpha(rom[2])) rom=rom.slice(2); + 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]=="."&& isAlpha(rom[2])) rom=rom.slice(2); + 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]=="."&& isAlpha(rom[2])) rom=rom.slice(2); + 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]=="."&& isAlpha(rom[2])) rom=rom.slice(2); + 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]=="."&& isAlpha(rom[2])) rom=rom.slice(2); + 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]=="."&& isAlpha(rom[2])) rom=rom.slice(2); + if((rom[1] == "." || rom[1] == "'")&& isAlpha(rom[2])) rom=rom.slice(2); else rom=rom.slice(1); } else { @@ -78,7 +78,7 @@ export function convert(input: string) }; if(flag) { c=c+syl[j][k]; - if(rom[2]=="."&& isAlpha(rom[3])) rom=rom.slice(3); + if((rom[2] == "." || rom[2] == "'")&& isAlpha(rom[3])) rom=rom.slice(3); else rom=rom.slice(2); } else { @@ -103,17 +103,17 @@ export function convert(input: string) }; if(flag) { c=c+syl[j][k]; - if(rom[3]=="." && isAlpha(rom[4])) rom=rom.slice(4); + 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]=="." && isAlpha(rom[4])) rom=rom.slice(4); + 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]=="." && isAlpha(rom[4])) rom=rom.slice(4); + if((rom[3] == "." || rom[3] == "'") && isAlpha(rom[4])) rom=rom.slice(4); else rom=rom.slice(3); } else {