Skip to content

Instantly share code, notes, and snippets.

@erikbgithub
Created August 25, 2010 11:12
Show Gist options
  • Save erikbgithub/549301 to your computer and use it in GitHub Desktop.
Save erikbgithub/549301 to your computer and use it in GitHub Desktop.
>>> parse_gramar('[HANZI],[PINYIN],[ENGL]#NEWLINE#')
{
'text': '[HANZI],[PINYIN],[ENGL]#NEWLINE#',
'type': 'Gramar',
'children': [
{
'text': 'HANZI',
'type': 'Variable',
'children': []
},
{
'text': ',',
'type': 'ClearText',
'children': []
},
{
'text': 'PINYIN',
'type': 'Variable',
'children': []
},
{
'text': ',',
'type': 'ClearText',
'children': []
},
{
'text': 'ENGL',
'type': 'Variable',
'children': []
},
{
'text': '\n',
'type': 'ClearText',
'children': []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment