makimoto / romaji Goto Github PK
View Code? Open in Web Editor NEWRomaji-Kana transliterator
Romaji-Kana transliterator
Hi, @makimoto.
I found some kana spellings were not correctly recognized.
> Romaji.kana2romaji('トゥエンティーフォー')
=> "toゥenthi-fo-"
> Romaji.kana2romaji('ドゥードゥー')
=> "doゥ-doゥ-"
> Romaji.kana2romaji('ドェントナ')
=> "doェntona"
Hello,
I found some common kana spellings were not correctly recognized by Romaji.kana2romaji.
[1] pry(main)> Romaji.kana2romaji "にゃにゅにょ"
=> "niャniュniョ"
[2] pry(main)> Romaji.kana2romaji "ニャニュニョ"
=> "niャniュniョ"
[3] pry(main)> Romaji.romaji2kana "nyanyunyo"
=> "ニャニュニョ"
例えば「シンオカチマチ」は「シノカチマチ」になってしまいます。
> Romaji.romaji2kana(Romaji.kana2romaji("シンオカチマチ"))
=> "シノカチマチ"
・・「正しい仕様がどうあるべき」なのかは中々難しい問題ですが。。
I tried using this library like below.
require "romaji/core_ext/string"
puts "tesuto".kana
but it raised undefined method 'normalize' for Romaji:Module (NoMethodError).
/user/.anyenv/envs/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/romaji-0.2.3/lib/romaji/string_extension.rb:6:in `normalize': undefined method `normalize' for Romaji:Module (NoMethodError)
from /user/.anyenv/envs/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/romaji-0.2.3/lib/romaji/string_extension.rb:14:in `kana'
from sample.rb:3:in `<main>'
The installation directory and the version of my ruby are below.
$ which ruby
/user/.anyenv/envs/rbenv/shims/ruby
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
Hi. I found broken results.
> Romaji.kana2romaji('ビャビュビョ')
=> "biャbiュbiョ"
> Romaji.kana2romaji(Romaji::ROMAJI2KANA.values.flatten.join)
=> "aiueo-nァィゥェォkakikukekokakukogagigugegosashisusesozajizuzezojajijujejotachitsutetodadidudedonaninunenohahifuhehobabibubebopapipupepovavivuvevofafifufefomamimumemoyaiyuiェyorarirurerorarirurerowawiuwewontsuヵヶヮxtsuャュョkyakiィkyukyekyogyagiィgyugyegyoshashiィshusheshoshashishusheshojajiィjujejojajiィjujejochachiィchuchechochachiィchuchechochachichuchechothathithuteェthodiャdiィdiュdiェdiョdhadhidhudhedhonyaniィnyunyenyohyahiィhyuhyehyobiャbiィbiュbiェbiョpyapiィpyupyepyomiャmiィmiュmiェmiョryariィryuryeryoryariィryuryeryo"
Hi! If I do "koohii" to katakana, I'm missing the ー. I see instead コオヒイ. I should add that I am just learning Japanese as a beginner. Is the lack of ー OK for native speakers? Or, is this something I could contribute a "pull" request for? (Assuming I find proper examples to add to the spec)
Matt
Any chance PR #5 is released anytime soon? I keep getting warning: duplicated key at line 28 ignored: "n"
on Ruby 2.2.0.
romajiを使ってソフトウェアを作っているのですがもし可能であればライセンスを明示するのを検討していただけないでしょうか?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.