Skip to content

Commit

Permalink
explainer: add private tag language fallback note
Browse files Browse the repository at this point in the history
  • Loading branch information
wacky6 authored Dec 8, 2021
1 parent 4ebb535 commit 3665f6d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ However, we aren't aware of any recognizer implementations that falls within thi
Web developers may provide subtags (e.g. region and script). The implementation should interpret them, and choose fallbacks if necessary. In general:

* If the provided language tag doesn't match any recognizer, remove the last subtag until there is a match. For example, `"zh-Hans-CN"` -> `"zh-Hans"` -> `"zh"`.
* If the provided language tag contains private tags (e.g. "zxx-x-shape"), the private tags shouldn't be removed. The implementation should take private tags into consideration when matching recognizers.
* If the browser can't match any recognizer (after the above fallbacks), `createHandwritingRecognizer` rejects with an Error.

If language model constraints aren't provided, the implementation should reject the promise with an error.
Expand Down

0 comments on commit 3665f6d

Please sign in to comment.