After one day of looking through Internet I ask this question here:
Is there any way to get pyparsing results, f.e.
result = longSentence.parseString(text.lower())
in a JSON format?
Update 11:46 27 May 2013:
Ok. So I try to make a parser for easy English.
The results for a sentence "Go 5 metres and what do you see?" now are printed as lists:
[[[['go'], [['5', 'metres']]]], 'and', ['what do you see?']]
['what do you see?']
is marked by SetResultsName('Question')
Others are marked similar.
It would be great if it will print that data in this form:
{
"Sentence1":
{
"Order":
{
"Predicate": 'go',
"Subject": ['5', 'metres']
}
},
"Sentence2":
{
"Question": 'what do you see?'
}
}