Skip to content

Commit 187181a

Browse files
committed
shiritori: include all noons
Change-Id: I2bbbac48c1d7b7447a979910f4996b61c8ec2011
1 parent 72d8410 commit 187181a

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
iconv -f euc-jp -t utf-8 edict2 -o edict2.utf8
1111

12-
1. 食べ物だけをフィルターする
12+
1. 名詞だけをフィルターする
1313

14-
cat edict2.utf8 | grep '/(n' | grep '{food}' > edict2-food.utf8
14+
cat edict2.utf8 | grep '(n)' > edict2-noun.utf8
1515

1616
1. 「Firebase Database」にアップロードする:
1717

1818
npm install scripts/
19-
node scripts/admin.js food edict2-food.utf8 /path/to/service-account
19+
node scripts/admin.js noun edict2-noun.utf8 /path/to/service-account
2020
^C
2121

2222
1. 「Firebase Functions」をデプロイする。
@@ -36,13 +36,14 @@
3636

3737
iconv -f euc-jp -t utf-8 edict2 -o edict2.utf8
3838

39-
1. 食べ物だけをフィルターする
39+
1. 名詞だけをフィルターする
4040

41-
cat edict2.utf8 | grep '/(n' | grep '{food}' > edict2-food.utf8
41+
cat edict2.utf8 | grep '(n)' > edict2-noun.utf8
4242

4343
1. ローカルのコーパスを作成する:
4444

45-
node scripts/admin.js food edict2-food.utf8 > functions/shiritori/corpus.json
45+
npm install scripts/
46+
node scripts/admin.js noun edict2-noun.utf8 > functions/shiritori/corpus.json
4647

4748
1. ローカルで起動してテストする:
4849

functions/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ const shiritori = require('./shiritori');
2020
const admin = require('firebase-admin');
2121
admin.initializeApp(functions.config().firebase);
2222

23+
const corpus = 'noun';
24+
2325
const dict = k => {
2426
return admin.database()
25-
.ref('food').child(k)
27+
.ref(corpus).child(k)
2628
.once('value')
2729
.then(snap => snap.val());
2830
};

0 commit comments

Comments
 (0)