Bridgeconn / usfm-grammar

An elegant USFM parser.
https://usfmgrammar.vachanengine.org/
MIT License
36 stars 14 forks source link

Remove quotes in List output #195

Closed kavitharaju closed 1 year ago

kavitharaju commented 1 year ago

Fixes #188 The to_list() API called within python was returning quoted strings.

[['Book', 'Chapter', 'Verse', 'Verse-Text', 'Notes', 'Milestone', 'Other'], 
['GEN', '1', '1', '"test with "quote" "', '""', '""', '""'], 
['GEN', '1', '2', '"and no quote "', '""', '""', '""']]

After the update

[['Book', 'Chapter', 'Verse', 'Verse-Text', 'Notes', 'Milestone', 'Other'], 
['GEN', '1', '1', 'test with "quote" ', '', '', ''], 
['GEN', '1', '2', 'and no quote ', '', '', '']]

Now using CSV writer in CLI to add quotes if required

Book    Chapter Verse   Verse-Text  Notes   Milestone   Other
GEN 1   1   "test with ""quote"" "          
GEN 1   2   and no quote