I'm currently working with a datastructure that presents itself like this:
['t','h','i','s',' ','i','s',' ','q','u','e','r','y',' ','i','t','e','m',' ','1','t','h','i','s',' ','i','s',' ','q','u','e','r','y',' ','i','t','e','m',' ','2', ['t','h','i','s',' ','i','s',' ','a',' ','s','u','b','q','u','e','r','y'], 't','h','i','s',' ','i','s',' ','q','u','e','r','y',' ','i','t','e','m',' ','3']
I got this dataset from parsing a query string using this answer from SO: https://stackoverflow.com/a/17141441
The query I parsed was:
(this is query item 1 this is query item 2(this is a subquery)this is query item 3)
The problem is that it deals with individual characters which are appended to the list one by one. I need to get back to a structure like:
['this is query item 1 this is query item 2', ['this is a subquery'], 'this is query item 3']
I'm trying to wrap my head around the parser function to do this or do a post-process step to push the characters back together. Anyone know of a solution for this?