Last active
August 29, 2015 14:06
-
-
Save akanehara/b19c9474d750b1ca5c39 to your computer and use it in GitHub Desktop.
きれいな駅名
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 駅名ひとつ分のデータ ekimei_t *) | |
type ekimei_t = { | |
kanji : string; | |
kana : string; | |
romaji : string; | |
shozoku : string; | |
} | |
(* 目的:駅名をきれいに表示する *) | |
let hyoji e = | |
match e with | |
{ kanji = kj; | |
kana = ka; | |
romaji = ro; | |
shozoku = sh; } -> sh ^ ", " ^ kj ^ "(" ^ ka ^ ")" | |
(* テスト *) | |
let hyoji1 = hyoji { kanji = "茗荷谷"; | |
kana = "みょうがだに"; | |
romaji = "MYOGADANI"; | |
shozoku = "丸ノ内線"; } = "丸ノ内線, 茗荷谷(みょうがだに)" | |
let hyoji2 = hyoji { kanji = "放出"; | |
kana = "はなてん"; | |
romaji = "HANATEN"; | |
shozoku = "学研都市線"; } = "学研都市線, 放出(はなてん)" | |
let hyoji3 = hyoji { kanji = "中百舌鳥"; | |
kana = "なかもず"; | |
romaji = "NAKAMOZU"; | |
shozoku = "御堂筋線"; } = "御堂筋線, 中百舌鳥(なかもず)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment