Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ tool does not recognize the token and cannot expand the template.
- §3.6 — new malformed forms: a reference to an undefined vocabulary, and a
cyclic reference chain; `<` and `>` join the unbalanced-metacharacter rule.
- §7 — the Expander conformance role MUST resolve inline vocabulary references.
- §3.4, §3 — a named slot MAY be written either `{name}` or `{{name}}`; the two
forms are exactly equivalent, with a conformant tool folding `{{name}}` to
`{name}`. The slot-name charset and whitespace rules apply to both. The
double-brace spelling is a slot, not a brace-escaping form; the grammar still
provides no escape.

### 1

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pre-spec status quo, `2` for one that is not backwards compatible.

| ID | Document | Version | Status |
|----|----------|---------|--------|
| OVOS-INTENT-1 | [Sentence Template Grammar](intent-1.md) | 1 | Draft |
| OVOS-INTENT-1 | [Sentence Template Grammar](intent-1.md) | 2 | Draft |
| OVOS-INTENT-2 | [Locale Resource Formats](intent-2.md) | 1 | Draft |
| OVOS-INTENT-3 | [Intent Definition](intent-3.md) | 1 | Draft |
| OVOS-INTENT-4 | [Intent and Entity Registration](intent-4.md) | 2 | Draft |
Expand Down
32 changes: 24 additions & 8 deletions intent-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,13 @@ A template is literal text interspersed with the tokens below.
| Literal word | `word` | — | Matched or spoken verbatim. |
| Alternatives | `(a\|b\|c)` | expansion | A choice of branches (§3.2). |
| Optional | `[x]` | expansion | An optional segment; equivalent to `(x\|)`. |
| Named slot | `{name}` | slot | A placeholder filled with a value (§5). |
| Named slot | `{name}` or `{{name}}` | slot | A placeholder filled with a value; the two forms are equivalent (§3.4, §5). |
| Vocabulary reference | `<name>` | expansion | Expands to a named vocabulary (§3.7). |

There is no slot-typing syntax, no digit token, no legacy wildcard, and no
brace-escaping form.
There is no slot-typing syntax, no digit token, and no legacy wildcard. A
named slot has two equivalent spellings, `{name}` and `{{name}}` (§3.4); the
double-brace spelling is a slot, not a brace-escaping form — the grammar
provides no way to write a literal brace, and none is needed (§2).

### 3.1 Literal words

Expand Down Expand Up @@ -150,17 +152,31 @@ turn on [the] lights
### 3.4 Named slots `{ }`

A curly-brace token is a **named slot** — a placeholder that is not written out
but *filled* with a value. The same `{name}` syntax is used everywhere a slot
but *filled* with a value. The same slot syntax is used everywhere a slot
appears; only *who fills it and when* differs by file type (§5.1).

A slot **name** MUST consist only of lowercase ASCII letters, digits, and
underscores (`a`–`z`, `0`–`9`, `_`), MUST NOT begin with a digit, and MUST NOT
contain whitespace inside the braces. A slot MAY appear anywhere
a literal word may, including inside an alternative or optional group:
A named slot MAY be written in **either** of two equivalent forms:

- single-brace — `{name}`;
- double-brace — `{{name}}`.

The two forms are **exactly equivalent**: a conformant tool folds `{{name}}`
to `{name}` and treats them identically thereafter. They denote the same slot,
fill the same way, and obey the same rules; there is no behavioural difference
between them. The double-brace form is a slot, **not** an escape: `{{` … `}}`
never produces a literal brace, and the grammar provides no brace-escaping form
(§2 makes brace characters impossible as literal input, so none is needed).

A slot **name** — the text inside the braces in either form — MUST consist only
of lowercase ASCII letters, digits, and underscores (`a`–`z`, `0`–`9`, `_`),
MUST NOT begin with a digit, and MUST NOT contain whitespace inside the braces.
These rules apply identically to `{name}` and `{{name}}`. A slot MAY appear
anywhere a literal word may, including inside an alternative or optional group:

```
(buy|sell) {item}
it is currently {temperature} degrees
(buy|sell) {{item}}
```

Slots are used only by `.intent` and `.dialog` files (§1.1).
Expand Down