How to use the wanakana.toRomaji function in wanakana

To help you get started, we’ve selected a few wanakana examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Mitorisia / Komugari / commands / utility / jisho.js View on Github external
console.log(jisho);
                if (jisho.data.length > 0) {
                    var content = jisho.data[0];
                    var senses = JSON.stringify(content.senses[0].english_definitions).replace(/\"/g, '').replace(/,/g, '\n');
                    senses = senses.substring(1, senses.length - 1);
                    senses = senses.replace(/^/gm, '•\u2000');
                    senses = senses.replace(/\\/g, "")

                    const embed = new Discord.MessageEmbed()
                        .setAuthor(`${content.japanese[0].word ? content.japanese[0].word : content.japanese[0].reading}`)
                        .setThumbnail('https://a.safe.moe/FB0Qi.png')
                        .setColor('#9678D2')
                        .setDescription(content.is_common ? '`Common Word`' : '`Not a Common Word`' + `\n[External Link](https://jisho.org/search/${query})`)
                        .addField(`❯\u2000\Definition`, `${senses}`)
                        .addBlankField()
                        .addField(`❯\u2000\Reading`, `•\u2000**Kana:** ${content.japanese[0].reading ? content.japanese[0].reading : '`N/A`'}\n\•\u2000**Romāji:** ${wanakana.toRomaji(content.japanese[0].reading)}`);
            return message.channel.send({ embed });

        } else {
            return message.channel.send(`No results found for **${query}**!`);
        }
    }
}
github MasuqaT-NET / BlogExamples / Web / WebWorker / filtering-with-ime-in-web-worker / src / worker.ts View on Github external
function normalize(arg: string): string {
  return toRomaji(
    arg.replace(/[A-Za-z0-9]/g, s =>
      String.fromCharCode(s.charCodeAt(0) - 0xfee0)
    )
  );
}
github project-yuki / YUKI / src / main / middlewares / MeCabMiddleware.ts View on Github external
public static kanaToRomaji (kana: string): string {
    return toRomaji(kana)
  }
github hexenq / kuroshiro / dist / node / kuroshiro.js View on Github external
for(var n1=0;n1" + options.delimiter_start + "<rt>" + wanakana.toKatakana(notations[n1][2]) + "</rt><rp>" + options.delimiter_end + "</rp>";
                        }
                    }
                }
                return result;
            case 'romaji':
                if(options.mode === 'okurigana')
                    for(var n2=0;n2" + options.delimiter_start + "<rt>" + wanakana.toRomaji(notations[n3][2]) + "</rt><rp>" + options.delimiter_end + "</rp>";
                    }
                    result += "";
                }
                return result;
            case 'hiragana':
                if(options.mode === 'okurigana'){
                    for(var n4=0;n4