README: custom dimensions and updated new lang instructions

Summary: .

Reviewed By: haoxuany

Differential Revision: D7937075

fbshipit-source-id: 3ae51e893773ca75cdd31e5c9bfde78077447f1b
This commit is contained in:
Julien Odent 2018-05-09 15:06:33 -07:00 committed by Facebook Github Bot
parent 963aa6b465
commit 8325fc0c5e

View File

@ -57,6 +57,8 @@ Please look into [this directory](https://github.com/facebook/duckling/blob/mast
| `Url` | "https://api.wit.ai/message?q=hi" | `{"value":"https://api.wit.ai/message?q=hi","domain":"api.wit.ai"}`
| `Volume` | "4 gallons" | `{"value":4,"type":"value","unit":"gallon"}`
[Custom dimensions](https://github.com/facebook/duckling/blob/master/exe/CustomDimensionExample.hs) are also supported.
## Extending Duckling
To regenerate the classifiers and run the test suite:
```
@ -66,10 +68,11 @@ $ stack build :duckling-regen-exe && stack exec duckling-regen-exe && stack test
It's important to regenerate the classifiers after updating the code and before
running the test suite.
To extend Duckling's support for a dimension in a given language, typically 2
To extend Duckling's support for a dimension in a given language, typically 3
files need to be updated:
* `Duckling/<dimension>/<language>/Rules.hs`
* `Duckling/<dimension>/<language>/Corpus.hs`
* `Duckling/<Dimension>/<Lang>/Rules.hs`
* `Duckling/<Dimension>/<Lang>/Corpus.hs`
* `Duckling/Dimensions/<Lang>.hs` (if not already present in `Duckling/Dimensions/Common.hs`)
To add a new language:
* Make sure that the language code used follows the [ISO-639-1 standard](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).