summaryrefslogtreecommitdiff
path: root/examples/json_schema_to_grammar.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/json_schema_to_grammar.py')
-rwxr-xr-xexamples/json_schema_to_grammar.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/json_schema_to_grammar.py b/examples/json_schema_to_grammar.py
index cd444d01..ab19e20d 100755
--- a/examples/json_schema_to_grammar.py
+++ b/examples/json_schema_to_grammar.py
@@ -29,9 +29,8 @@ class BuiltinRule:
self.content = content
self.deps = deps or []
-# whitespace is constrained to a single space char to prevent model "running away" in
-# whitespace. Also maybe improves generation quality?
-SPACE_RULE = '" "?'
+# Constraining spaces to prevent model "running away".
+SPACE_RULE = '| " " | "\\n" [ \\t]{0,20}'
PRIMITIVE_RULES = {
'boolean' : BuiltinRule('("true" | "false") space', []),