<s> from dragonfly import ( Grammar , AppContext , MappingRule , Dictation , Key , Text , Integer ) <EOL> context = AppContext ( title = "<STR_LIT>" ) <EOL> grammar = Grammar ( "<STR_LIT>" , context = context ) <EOL> rules = MappingRule ( <EOL> name = "<STR_LIT>" , <EOL> mapping = { <EOL> "<STR_LIT>" : Key ( "<STR_LIT>" ) , <EOL> "<STR_LIT>" : Text ( "<STR_LIT>" ) , <EOL> "<STR_LIT>" : Text ( "<STR_LIT>" ) + Key ( "<STR_LIT>" ) , <EOL> "<STR_LIT>" : Text ( "<STR_LIT>" ) , <EOL> } , <EOL> extras = [ <EOL> Dictation ( "<STR_LIT:text>" ) , <EOL> Integer ( "<STR_LIT:n>" , <NUM_LIT:0> , <NUM_LIT> ) , <EOL> ] , <EOL> defaults = { <EOL> "<STR_LIT:n>" : <NUM_LIT:1> <EOL> } <EOL> ) <EOL> grammar . add_rule ( rules ) <EOL> grammar . load ( ) <EOL> def unload ( ) : <EOL> global grammar <EOL> if grammar : grammar . unload ( ) <EOL> grammar = None </s>
