ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - ikeikeikeike/exkanji: A Elixir library for translating between hiragana, katakana, romaji, kanji and sound. It uses Mecab.
A Elixir library for translating between hiragana, katakana, romaji, kanji and sound. It uses Mecab. - ikeikeikeike/exkanji
Visit Site

GitHub - ikeikeikeike/exkanji: A Elixir library for translating between hiragana, katakana, romaji, kanji and sound. It uses Mecab.

GitHub - ikeikeikeike/exkanji: A Elixir library for translating between hiragana, katakana, romaji, kanji and sound. It uses Mecab.

Exkanji

Build Status Hex version Hex downloads Inline docs hex.pm

A Elixir library for translating between hiragana, katakana, romaji, kanji and sound. It uses Mecab.

Installation

If available in Hex, the package can be installed as:

  1. Add exkanji to your list of dependencies in mix.exs:
def deps do
  [{:exkanji, "~> x.x"}]
end
  1. Exkanji package needs nkf and mecab command and it needs to install those in your environment when you don't have those.
$ brew install nkf
$ brew install mecab mecab-ipadic

Usage

Exkanji provides some convinient functions in Exkanji module through Exkanji.Translator and Exkanji.Mecab. Those provided functions are able to translate into hiragana(ひらがな), katakana(カタカナ), romaji(ローマ字) and sound(五十音).

Into hiragana(ひらがな)

iex(1)> Exkanji.hiragana "a a A ア ア ァ ァ あ ぁ 亜"
"あ あ あ あ あ ぁ ぁ あ ぁ あ"
iex(2)> Exkanji.hiragana "平仮名 ひらがな hiragana"
"ひらがな ひらがな ひらがな"

Into katakana(カタカナ)

iex(3)> Exkanji.katakana "a a A ア ア ァ ァ あ ぁ 亜"
"ア ア ア ア ア ァ ァ ア ァ ア"
iex(4)> Exkanji.katakana "片仮名 かたかな katakana"
"カタカナ カタカナ カタカナ"

Into romaji(ローマ字)

iex(5)> Exkanji.romaji "a a A ア ア ァ ァ あ ぁ 亜"
"a a a a a ァ ァ a ァ a"
iex(6)> Exkanji.romaji "ローマ字 ろーまじ ローマジ"
"ro-maji ro-maji ro-maji"

Into sound(五十音)

iex(7)> Exkanji.sound "よろしく"
"や"
iex(8)> Exkanji.sound "夜露死苦"
"や"

As a Morphological Analyzer.

Exkanji is capable of detecting Part-of-Speech from text, As a Morphological Analyzer. It uses Mecab.

iex(1)> Exkanji.parse "エモい"
{:ok,
 [%Exkanji.Mecab{base: "*", cform: "*", ctype: "*",
   feature: "名詞,一般,*,*,*,*,*", hiragana: nil, pos: "名詞",
   pos1: "一般", pos2: "*", pos3: "*", pron: nil, read: nil, romaji: nil,
   surface: "エモ"},
  %Exkanji.Mecab{base: "いる", cform: "一段", ctype: "連用形",
   feature: "動詞,自立,*,*,一段,連用形,いる,イ,イ", hiragana: nil,
   pos: "動詞", pos1: "自立", pos2: "*", pos3: "*", pron: "イ",
   read: "イ", romaji: nil, surface: "い"}]}

It also makes to change that sets Mecab's dictionaly into second arguments in Exkanji.parse function.

iex(2)> Exkanji.parse "エモい", dict: "/opt/local/lib/mecab/dic/neologd-utf8"
{:ok,
 [%Exkanji.Mecab{base: "エモい", cform: "*", ctype: "*",
   feature: "名詞,固有名詞,一般,*,*,*,エモい,エモイ,エモイ",
   hiragana: nil, pos: "名詞", pos1: "固有名詞", pos2: "一般",
   pos3: "*", pron: "エモイ", read: "エモイ", romaji: nil,
   surface: "エモい"}]}

API Reference.

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory