allow usage of ' for . in cherokee

This commit is contained in:
Daniel Løvbrøtte Olsen 2019-03-14 23:32:30 +01:00
parent 919ee380d2
commit bb4b7a6534
2 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
const version = "2.2.0"; const version = "2.2.1";
import x2i from "./x2i"; import x2i from "./x2i";
import { existsSync } from "fs"; import { existsSync } from "fs";
@ -91,7 +91,7 @@ Thanks to Tuugaalikkuluk for the encoding`;
function xchr(roomId) { function xchr(roomId) {
var message = `I'm sadly not smart enough to know which syllable to use in certain situations. 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. 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 Thanks to Tuugaalikkuluk for the encoding

View File

@ -23,37 +23,37 @@ export function convert(input: string)
else if (i==1) { else if (i==1) {
if (rom[0].toLowerCase()=='a') { if (rom[0].toLowerCase()=='a') {
c=c+''; 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 rom=rom.slice(1);
} }
else if (rom[0].toLowerCase()=='e') { else if (rom[0].toLowerCase()=='e') {
c=c+''; 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 rom=rom.slice(1);
} }
else if (rom[0].toLowerCase()=='i') { else if (rom[0].toLowerCase()=='i') {
c=c+''; 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 rom=rom.slice(1);
} }
else if (rom[0].toLowerCase()=='o') { else if (rom[0].toLowerCase()=='o') {
c=c+'Ꭳ'; 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 rom=rom.slice(1);
} }
else if (rom[0].toLowerCase()=='u') { else if (rom[0].toLowerCase()=='u') {
c=c+'Ꭴ'; 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 rom=rom.slice(1);
} }
else if (rom[0].toLowerCase()=='v') { else if (rom[0].toLowerCase()=='v') {
c=c+''; 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 rom=rom.slice(1);
} }
else if (rom[0].toLowerCase()=='s') { else if (rom[0].toLowerCase()=='s') {
c=c+'Ꮝ'; 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 rom=rom.slice(1);
} }
else { else {
@ -78,7 +78,7 @@ export function convert(input: string)
}; };
if(flag) { if(flag) {
c=c+syl[j][k]; 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 rom=rom.slice(2);
} }
else { else {
@ -103,17 +103,17 @@ export function convert(input: string)
}; };
if(flag) { if(flag) {
c=c+syl[j][k]; 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 rom=rom.slice(3);
} }
else if (rom.slice(0,3).toLowerCase()=="nah") { else if (rom.slice(0,3).toLowerCase()=="nah") {
c=c+""; 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 rom=rom.slice(3);
} }
else if (rom.slice(0,3).toLowerCase()=="hna") { else if (rom.slice(0,3).toLowerCase()=="hna") {
c=c+"Ꮏ"; 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 rom=rom.slice(3);
} }
else { else {