Skip to content

Instantly share code, notes, and snippets.

@opparco
Created July 24, 2023 09:05
Show Gist options
  • Save opparco/f3ab778410e544fbfc20ca950a671e5b to your computer and use it in GitHub Desktop.
Save opparco/f3ab778410e544fbfc20ca950a671e5b to your computer and use it in GitHub Desktop.
#
filename = '../grammars/japanese.gbnf'
print(f"overwrite {filename}")
with open(filename, 'w', encoding='utf-8') as f:
f.write("""#
root ::= char+ ([ \\t\\n] char+)*
char ::= [\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF\uFF21-\uFF3A\uFF41-\uFF5A\uFF10-\uFF19]""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment