酒蔵名の読み仮名をひらがなに統一する
Closed this issue · 4 comments
現在の画面上、
- 新規登録画面上は当該欄のラベルはひらがな
- 更新画面上は同ラベルはカタカナ
(データもカタカナで入っている)
どちらかに統一した方が良い
可読性を考えると、ひらがなの方が良いのではないかと思います。
ひらがなで統一させるスクリプトを作るので、今は追加分だけひらがなで入れておいてくれればOKです。
「づ」、「ゔ」にも対応したバージョンのスクリプトです。
$ mongodb
use データベース名
の後で実行します。
db.breweries.find({$and: [{kana: {$exists: true}}, {kana: {$ne: null}}, {kana: {$ne: ''}}]}).forEach(function(row) {
row.kana = row.kana.replace("ア","あ");
row.kana = row.kana.replace("イ","い");
row.kana = row.kana.replace("ウ","う");
row.kana = row.kana.replace("エ","え");
row.kana = row.kana.replace("オ","お");
row.kana = row.kana.replace("カ","か");
row.kana = row.kana.replace("キ","き");
row.kana = row.kana.replace("ク","く");
row.kana = row.kana.replace("ケ","け");
row.kana = row.kana.replace("コ","こ");
row.kana = row.kana.replace("サ","さ");
row.kana = row.kana.replace("シ","し");
row.kana = row.kana.replace("ス","す");
row.kana = row.kana.replace("セ","せ");
row.kana = row.kana.replace("ソ","そ");
row.kana = row.kana.replace("タ","た");
row.kana = row.kana.replace("チ","ち");
row.kana = row.kana.replace("ツ","つ");
row.kana = row.kana.replace("テ","て");
row.kana = row.kana.replace("ト","と");
row.kana = row.kana.replace("ナ","な");
row.kana = row.kana.replace("ニ","に");
row.kana = row.kana.replace("ヌ","ぬ");
row.kana = row.kana.replace("ネ","ね");
row.kana = row.kana.replace("ノ","の");
row.kana = row.kana.replace("ハ","は");
row.kana = row.kana.replace("ヒ","ひ");
row.kana = row.kana.replace("フ","ふ");
row.kana = row.kana.replace("ヘ","へ");
row.kana = row.kana.replace("ホ","ほ");
row.kana = row.kana.replace("マ","ま");
row.kana = row.kana.replace("ミ","み");
row.kana = row.kana.replace("ム","む");
row.kana = row.kana.replace("メ","め");
row.kana = row.kana.replace("モ","も");
row.kana = row.kana.replace("ヤ","や");
row.kana = row.kana.replace("ユ","ゆ");
row.kana = row.kana.replace("ヨ","よ");
row.kana = row.kana.replace("ラ","ら");
row.kana = row.kana.replace("リ","り");
row.kana = row.kana.replace("ル","る");
row.kana = row.kana.replace("レ","れ");
row.kana = row.kana.replace("ロ","ろ");
row.kana = row.kana.replace("ワ","わ");
row.kana = row.kana.replace("ヰ","ゐ");
row.kana = row.kana.replace("ヱ","ゑ");
row.kana = row.kana.replace("ヲ","を");
row.kana = row.kana.replace("ン","ん");
row.kana = row.kana.replace("ガ","が");
row.kana = row.kana.replace("ギ","ぎ");
row.kana = row.kana.replace("グ","ぐ");
row.kana = row.kana.replace("ゲ","げ");
row.kana = row.kana.replace("ゴ","ご");
row.kana = row.kana.replace("ザ","ざ");
row.kana = row.kana.replace("ジ","じ");
row.kana = row.kana.replace("ズ","ず");
row.kana = row.kana.replace("ゼ","ぜ");
row.kana = row.kana.replace("ゾ","ぞ");
row.kana = row.kana.replace("ダ","だ");
row.kana = row.kana.replace("ヂ","ぢ");
row.kana = row.kana.replace("ヅ","づ");
row.kana = row.kana.replace("デ","で");
row.kana = row.kana.replace("ド","ど");
row.kana = row.kana.replace("バ","ば");
row.kana = row.kana.replace("ビ","び");
row.kana = row.kana.replace("ブ","ぶ");
row.kana = row.kana.replace("ベ","べ");
row.kana = row.kana.replace("ボ","ぼ");
row.kana = row.kana.replace("パ","ぱ");
row.kana = row.kana.replace("ピ","ぴ");
row.kana = row.kana.replace("プ","ぷ");
row.kana = row.kana.replace("ペ","ぺ");
row.kana = row.kana.replace("ポ","ぽ");
row.kana = row.kana.replace("ヴ","ゔ");
row.kana = row.kana.replace("ァ","ぁ");
row.kana = row.kana.replace("ィ","ぃ");
row.kana = row.kana.replace("ゥ","ぅ");
row.kana = row.kana.replace("ェ","ぇ");
row.kana = row.kana.replace("ォ","ぉ");
row.kana = row.kana.replace("ッ","っ");
row.kana = row.kana.replace("ャ","ゃ");
row.kana = row.kana.replace("ュ","ゅ");
row.kana = row.kana.replace("ョ","ょ");
row.kana = row.kana.replace("ア","あ");
row.kana = row.kana.replace("イ","い");
row.kana = row.kana.replace("ウ","う");
row.kana = row.kana.replace("エ","え");
row.kana = row.kana.replace("オ","お");
row.kana = row.kana.replace("カ","か");
row.kana = row.kana.replace("キ","き");
row.kana = row.kana.replace("ク","く");
row.kana = row.kana.replace("ケ","け");
row.kana = row.kana.replace("コ","こ");
row.kana = row.kana.replace("サ","さ");
row.kana = row.kana.replace("シ","し");
row.kana = row.kana.replace("ス","す");
row.kana = row.kana.replace("セ","せ");
row.kana = row.kana.replace("ソ","そ");
row.kana = row.kana.replace("タ","た");
row.kana = row.kana.replace("チ","ち");
row.kana = row.kana.replace("ツ","つ");
row.kana = row.kana.replace("テ","て");
row.kana = row.kana.replace("ト","と");
row.kana = row.kana.replace("ナ","な");
row.kana = row.kana.replace("ニ","に");
row.kana = row.kana.replace("ヌ","ぬ");
row.kana = row.kana.replace("ネ","ね");
row.kana = row.kana.replace("ノ","の");
row.kana = row.kana.replace("ハ","は");
row.kana = row.kana.replace("ヒ","ひ");
row.kana = row.kana.replace("フ","ふ");
row.kana = row.kana.replace("ヘ","へ");
row.kana = row.kana.replace("ホ","ほ");
row.kana = row.kana.replace("マ","ま");
row.kana = row.kana.replace("ミ","み");
row.kana = row.kana.replace("ム","む");
row.kana = row.kana.replace("メ","め");
row.kana = row.kana.replace("モ","も");
row.kana = row.kana.replace("ヤ","や");
row.kana = row.kana.replace("ユ","ゆ");
row.kana = row.kana.replace("ヨ","よ");
row.kana = row.kana.replace("ラ","ら");
row.kana = row.kana.replace("リ","り");
row.kana = row.kana.replace("ル","る");
row.kana = row.kana.replace("レ","れ");
row.kana = row.kana.replace("ロ","ろ");
row.kana = row.kana.replace("ワ","わ");
row.kana = row.kana.replace("ヲ","を");
row.kana = row.kana.replace("ン","ん");
row.kana = row.kana.replace("ガ","が");
row.kana = row.kana.replace("ギ","ぎ");
row.kana = row.kana.replace("グ","ぐ");
row.kana = row.kana.replace("ゲ","げ");
row.kana = row.kana.replace("ゴ","ご");
row.kana = row.kana.replace("ザ","ざ");
row.kana = row.kana.replace("ジ","じ");
row.kana = row.kana.replace("ズ","ず");
row.kana = row.kana.replace("ゼ","ぜ");
row.kana = row.kana.replace("ゾ","ぞ");
row.kana = row.kana.replace("ダ","だ");
row.kana = row.kana.replace("ヂ","ぢ");
row.kana = row.kana.replace("ヅ","づ");
row.kana = row.kana.replace("デ","で");
row.kana = row.kana.replace("ド","ど");
row.kana = row.kana.replace("バ","ば");
row.kana = row.kana.replace("ビ","び");
row.kana = row.kana.replace("ブ","ぶ");
row.kana = row.kana.replace("ベ","べ");
row.kana = row.kana.replace("ボ","ぼ");
row.kana = row.kana.replace("パ","ぱ");
row.kana = row.kana.replace("ピ","ぴ");
row.kana = row.kana.replace("プ","ぷ");
row.kana = row.kana.replace("ペ","ぺ");
row.kana = row.kana.replace("ポ","ぽ");
row.kana = row.kana.replace("ヴ","ゔ");
row.kana = row.kana.replace("ァ","ぁ");
row.kana = row.kana.replace("ィ","ぃ");
row.kana = row.kana.replace("ゥ","ぅ");
row.kana = row.kana.replace("ェ","ぇ");
row.kana = row.kana.replace("ォ","ぉ");
row.kana = row.kana.replace("ッ","っ");
row.kana = row.kana.replace("ャ","ゃ");
row.kana = row.kana.replace("ュ","ゅ");
row.kana = row.kana.replace("ョ","ょ");
row.kana = row.kana.replace("ー","ー");
db.breweries.save(row);
});
db.breweries.find({$and: [{kana: {$exists: true}}, {kana: {$ne: null}}, {kana: {$ne: ''}}]}).forEach(function(row) {
row.kana = row.kana.replace("が","が");
row.kana = row.kana.replace("ぎ","ぎ");
row.kana = row.kana.replace("ぐ","ぐ");
row.kana = row.kana.replace("げ","げ");
row.kana = row.kana.replace("ご","ご");
row.kana = row.kana.replace("ざ","ざ");
row.kana = row.kana.replace("じ","じ");
row.kana = row.kana.replace("ず","ず");
row.kana = row.kana.replace("ぜ","ぜ");
row.kana = row.kana.replace("ぞ","ぞ");
row.kana = row.kana.replace("だ","だ");
row.kana = row.kana.replace("ぢ","ぢ");
row.kana = row.kana.replace("づ","づ");
row.kana = row.kana.replace("で","で");
row.kana = row.kana.replace("ど","ど");
row.kana = row.kana.replace("ば","ば");
row.kana = row.kana.replace("び","び");
row.kana = row.kana.replace("ぶ","ぶ");
row.kana = row.kana.replace("べ","べ");
row.kana = row.kana.replace("ぼ","ぼ");
row.kana = row.kana.replace("ぱ","ぱ");
row.kana = row.kana.replace("ぴ","ぴ");
row.kana = row.kana.replace("ぷ","ぷ");
row.kana = row.kana.replace("ぺ","ぺ");
row.kana = row.kana.replace("ぽ","ぽ");
row.kana = row.kana.replace("ゔ","ゔ");
db.breweries.save(row);
});
APIたたいて最新の酒蔵情報を確認したところ、ふりがなは、ひらがなに統一されていましたのでcloseですね。
https://docs.google.com/spreadsheets/d/1sbYP_nIy8TR4hwRKhgiJ7DRiSsRAcom0IO4_76oH1QY/edit?usp=sharing(私がCloseしても良かった?)
@shinjima2 確認ありがとうございます!