File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 9
9
10
10
iconv -f euc-jp -t utf-8 edict2 -o edict2.utf8
11
11
12
- 1 . 食べ物だけをフィルターする :
12
+ 1 . 名詞だけをフィルターする :
13
13
14
- cat edict2.utf8 | grep '/(n' | grep '{food}' > edict2-food .utf8
14
+ cat edict2.utf8 | grep '(n)' > edict2-noun .utf8
15
15
16
16
1 . 「Firebase Database」にアップロードする:
17
17
18
18
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
20
20
^C
21
21
22
22
1 . 「Firebase Functions」をデプロイする。
36
36
37
37
iconv -f euc-jp -t utf-8 edict2 -o edict2.utf8
38
38
39
- 1 . 食べ物だけをフィルターする :
39
+ 1 . 名詞だけをフィルターする :
40
40
41
- cat edict2.utf8 | grep '/(n' | grep '{food}' > edict2-food .utf8
41
+ cat edict2.utf8 | grep '(n)' > edict2-noun .utf8
42
42
43
43
1 . ローカルのコーパスを作成する:
44
44
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
46
47
47
48
1 . ローカルで起動してテストする:
48
49
Original file line number Diff line number Diff line change @@ -20,9 +20,11 @@ const shiritori = require('./shiritori');
20
20
const admin = require ( 'firebase-admin' ) ;
21
21
admin . initializeApp ( functions . config ( ) . firebase ) ;
22
22
23
+ const corpus = 'noun' ;
24
+
23
25
const dict = k => {
24
26
return admin . database ( )
25
- . ref ( 'food' ) . child ( k )
27
+ . ref ( corpus ) . child ( k )
26
28
. once ( 'value' )
27
29
. then ( snap => snap . val ( ) ) ;
28
30
} ;
You can’t perform that action at this time.
0 commit comments