Last active
September 30, 2020 18:35
-
-
Save orumin/d5b6a001311905ba27593ac3009567dc to your computer and use it in GitHub Desktop.
generate madosoft's game title like text
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
.PHONY: all yakisuto namadere wagahai unpack | |
JA_DICT=SKK-JISYO.L.utf8 | |
EN_DICT=SKK-JISYO.edict.utf8 | |
DICTS=$(JA_DICT) $(EN_DICT) | |
WORD_LISTS=4ch-words.txt 6ch-words.txt en-words-ea5.txt en-words-n5.txt en-words-ic.txt | |
all: $(WORD_LISTS) | |
@for i in `seq 5`; \ | |
do \ | |
echo `shuf 4ch-words.txt | head -n 1``shuf 6ch-words.txt | head -n 1`; \ | |
done | |
yakisuto: $(WORD_LISTS) | |
@for i in `seq 5`; \ | |
do \ | |
echo `shuf 4ch-words.txt | head -n 1``shuf en-words-ea5.txt | head -n 1`; \ | |
done | |
namadere: $(WORD_LISTS) | |
@for i in `seq 5`; \ | |
do \ | |
echo `shuf 4ch-words.txt | head -n 1``shuf en-words-n5.txt | head -n 1`; \ | |
done | |
wagahai: $(WORD_LISTS) | |
@for i in `seq 5`; \ | |
do \ | |
echo `shuf 4ch-words.txt | head -n 1``shuf en-words-ic.txt | head -n 1`; \ | |
done | |
$(EN_DICT): | |
curl -LO http://openlab.jp/skk/dic/SKK-JISYO.edict.tar.gz | |
tar -xzf SKK-JISYO.edict.tar.gz | |
iconv -f euc-jp -t utf8 SKK-JISYO.edict > SKK-JISYO.edict.utf8 | |
$(JA_DICT): | |
curl -LO http://openlab.jp/skk/dic/SKK-JISYO.L.gz | |
gunzip SKK-JISYO.L.gz | |
iconv -f euc-jp -t utf8 SKK-JISYO.L > SKK-JISYO.L.utf8 | |
$(WORD_LISTS): $(DICTS) | |
grep -E '^[ぁ-ん]{4} /' SKK-JISYO.L.utf8 | awk '{print $$1}' > 4ch-words.txt | |
grep -oE '/[ァ-ン]{6}/$$' SKK-JISYO.edict.utf8 | awk -F'/' '{print $$2}' > 6ch-words.txt | |
grep -oE '/[ァ-ン]{3}ー[ァ-ン]/$$' SKK-JISYO.edict.utf8 | awk -F'/' '{print $$2}' > en-words-ea5.txt | |
grep -oE '/[ァ-ン]+ション/$$' SKK-JISYO.edict.utf8 | awk -F'/' '{print $$2}' > en-words-n5.txt | |
grep -oE '/[ァ-ン]+ック/$$' SKK-JISYO.edict.utf8 | awk -F'/' '{print $$2}' > en-words-ic.txt | |
unpack: $(WORD_LISTS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment