|
1 |
| -# しりとり Actions on Google Sample |
| 1 | +# しりとり Dialogflow サンプルゲーム |
2 | 2 |
|
3 |
| -しりとりのゲーム. |
| 3 | +## 設定 |
4 | 4 |
|
5 |
| -## Setup |
6 |
| - |
7 |
| -1. Create [Dialogflow](https://dialogflow.com/) Project. |
8 |
| -1. Enable fullfillment using firebase functions. |
9 |
| -1. Download `edict2` dictionary from http://www.edrdg.org/jmdict/edict_doc.html. |
10 |
| -1. Convert the dictionary to utf-8: |
| 5 | +1. 「[Dialogflow](https://dialogflow.com/)」のプロジェクトを作成する。 |
| 6 | +1. 「Firebase Cloud Functions」のfullfillmentをつかう。 |
| 7 | +1. [edict2](http://www.edrdg.org/jmdict/edict_doc.html)の辞書をダウンロードする。 |
| 8 | +1. utf-8に変換する: |
11 | 9 |
|
12 | 10 | iconv -f euc-jp -t utf-8 edict2 -o edict2.utf8
|
13 | 11 |
|
14 |
| -1. Extract only food noons: |
| 12 | +1. 食べ物だけをフィルターする: |
15 | 13 |
|
16 | 14 | cat edict2.utf8 | grep '/(n' | grep '{food}' > edict2-food.utf8
|
17 | 15 |
|
18 |
| -1. Load corpus in firebase realtime database. |
| 16 | +1. 「Firebase Database」にアップロードする: |
19 | 17 |
|
20 | 18 | npm install scripts/
|
21 | 19 | node scripts/admin.js food edict2-food.utf8 /path/to/service-account
|
22 | 20 | ^C
|
23 | 21 |
|
24 |
| -1. Deploy firebase functions. |
| 22 | +1. 「Firebase Functions」をデプロイする。 |
25 | 23 |
|
26 | 24 | firebase deploy
|
27 | 25 |
|
28 |
| -1. Bump the `shiritori` cloud functions memory allocation to 512MB. |
29 |
| -1. Set locale to japanese in the simulator. |
30 |
| -1. Try the Assistant app. |
| 26 | +1. [Cloud Console](https://console.cloud.google.com)で `shiritori` のRAMを512MBまで上げる。 |
| 27 | +1. 「Actions on Google Simulator」でロケールを日本語に設定する。 |
| 28 | +1. アシスタントアプリをテストしてみる。 |
31 | 29 |
|
32 | 30 | > テスト用アプリにつないで
|
33 | 31 |
|
34 |
| -## Test locally |
| 32 | +## ローカルでのテスト |
35 | 33 |
|
36 |
| -1. Download `edict2` dictionary from http://www.edrdg.org/jmdict/edict_doc.html. |
37 |
| -1. Convert the dictionary to utf-8: |
| 34 | +1. [edict2](http://www.edrdg.org/jmdict/edict_doc.html)の辞書をダウンロードする。 |
| 35 | +1. utf-8に変換する: |
38 | 36 |
|
39 | 37 | iconv -f euc-jp -t utf-8 edict2 -o edict2.utf8
|
40 | 38 |
|
41 |
| -1. Extract only food noons: |
| 39 | +1. 食べ物だけをフィルターする: |
42 | 40 |
|
43 | 41 | cat edict2.utf8 | grep '/(n' | grep '{food}' > edict2-food.utf8
|
44 | 42 |
|
45 |
| -1. Generate local corpus: |
| 43 | +1. ローカルのコーパスを作成する: |
46 | 44 |
|
47 |
| - npm install scripts/ |
48 | 45 | node scripts/admin.js food edict2-food.utf8 > functions/shiritori/corpus.json
|
49 | 46 |
|
50 |
| -1. Try locally: |
| 47 | +1. ローカルで起動してテストする: |
51 | 48 |
|
52 |
| - node functions/shiritori/main.js |
| 49 | + node functions/shiritori/main.js |
53 | 50 |
|
54 | 51 | ```
|
55 | 52 | しりとり
|
|
0 commit comments