Write me a gbnf grammar. When a paragraph starts with " it should end at the next…
- User
Write me a gbnf grammar. When a paragraph starts with " it should end at the next occurance of ", so after that only a newline or <|end_of_sentence|> are allowed. When a paragraph starts with ( it should end at the next occurance of ), so after that only a newline or <|end_of_sentence|> are allowed. Should a paragraph start without " or (, it should not be allowed to contain " and ().
Assistant
Here's a GBNF grammar that meets your requirements:
root ::= paragraph* paragraph ::= quoted_paragraph | parenthetical_paragraph | regular_paragraph quoted_paragraph ::= "\"" quoted_content "\"" end_marker parenthetical_paragraph ::= "(" paren_content ")" end_marker regular_paragraph ::= regular_content end_marker end_marker ::= "\n" | "<|end_of_sentence|>" quoted_content ::= [^"]* paren_content ::= [^)]* regular_content ::= [^"()\n<]+
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.