Skip to content

Instantly share code, notes, and snippets.

@moriyamahiroshi
Created August 8, 2012 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moriyamahiroshi/3291562 to your computer and use it in GitHub Desktop.
Save moriyamahiroshi/3291562 to your computer and use it in GitHub Desktop.
「アイドルマスター」のカップリング表記を出力する
(ql:quickload "cl-ppcre")
(defun seikanadict-list-imas-slashes (output)
"「アイドルマスター」のカップリング表記をストリーム OUTPUT へ書き出す。"
(flet ((to-gendai (hiragana)
(setf hiragana (cl-ppcre:regex-replace-all "あづ" hiragana "あず"))
(setf hiragana (cl-ppcre:regex-replace-all "しゃう" hiragana "しょう"))
(setf hiragana (cl-ppcre:regex-replace-all "りゃう" hiragana "りょう"))
(setf hiragana (cl-ppcre:regex-replace-all "ゑ" hiragana "え"))
hiragana))
(let ((list
;; 765プロ
'(("はる" . "天海春香") ("ちは" . "如月千早") ("ゆき" . "萩原雪歩")
("やよ" . "高槻やよひ") ("りつ" . "秋月律子")
("あづ" . "三浦あづさ") ("いお" . "水瀬伊織") ("まこ" . "菊池眞")
("あみ" . "雙海亞美") ("まみ" . "雙海眞美") ("みき" . "星井美希")
("ひび" . "我那霸響") ("たか" . "四條貴音") ("こと" . "音無小鳥")
;; 876プロ
("あい" . "日高愛") ("ゑり" . "水谷繪理") ("りゃう" . "秋月涼")
;; 961プロ
("とう" . "天ヶ瀬冬馬") ("ほく" . "伊集院北斗")
("しゃう" . "御手洗翔太"))))
(loop for L in list
do (loop for R in list
unless (equal (cdr L) (cdr R))
do (format output
(concatenate 'string
"\"~A~A\"," ;Heading ;1
"\"普通名詞\"," ;POS
"\"~A~A\"," ;Kana ;2
"\"~A~A\"," ;Surface ;3
"\"~A~A\"," ;Kana/Gendai ;4
"\"~A~A\"," ;Surface/Gendai ;5
"0," ;Frequency
"\"imas\"," ;Categories
"\"~A×~A\"" ;Description ;6
"~%")
(car L) (car R) ;1
(car L) (car R) ;2
(car L) (car R) ;3
(to-gendai (car L)) (to-gendai (car R)) ;4
(to-gendai (car L)) (to-gendai (car R)) ;5
(cdr L) (cdr R))))))) ;6
(seikanadict-list-imas-slashes *standard-output*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment