Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ For this exercise, we'll convert hiragana to romanji. For instance, "ひらが
There are many different ways to romanize hiragana. For the exercise, we'll use the [Nihon-shiki system](http://en.wikipedia.org/wiki/Nihon-shiki_romanization), as it is the most regular.

To get you started, there is a test harness you can run with `ruby test/test_romanize.rb`.

# Test push via https
66 changes: 66 additions & 0 deletions lib/romanize.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,70 @@
module Romanize

def romanize(s)
end

HRMAP = {
"か" => "ka",
"さ" => "sa",
"た" => "ta",
"な" => "na",
"は" => "ha",
"ま" => "ma",
"や" => "ya",
"ら" => "ra",
"わ" => "wa",
"ん" => "n",
"き" => "ki",
"し" => "si",
"ち" => "ti",
"に" => "ni",
"ひ" => "hi",
"み" => "mi",
"く" => "ku",
"す" => "su",
"つ" => "tu",
"ぬ" => "nu",
"ふ" => "hu",
"む" => "mu",
"け" => "ke",
"せ" => "se",
"て" => "te",
"ね" => "ne",
"へ" => "he",
"め" => "me",
"こ" => "ko",
"そ" => "so",
"と" => "to",
"の" => "no",
"ほ" => "ho",
"も" => "mo",
"ゆ" => "yu",
"よ" => "yo",
"り" => "ri",
"る" => "ru",
"れ" => "re",
"ろ" => "ro"
"きゃ" => "kya",
"しゃ" => "sya",
"ちゃ" => "tya",
"にゃ" => "nya",
"ひゃ" => "hya",
"みゃ" => "mya",
"りゃ" => "rya",
"きゅ" => "kyu",
"しゅ" => "syu",
"ちゅ" => "tyu",
"にゅ" => "nyu",
"ひゅ" => "hyu",
"みゅ" => "myu",
"りゅ" => "ryu",
"きょ" => "kyo",
"しょ" => "syo",
"ちょ" => "tyo",
"にょ" => "nyo",
"ひょ" => "hyo",
"みょ" => "myo",
"りょ" => "ryo"
}

end