mangiucugna / json_repair

A python module to repair invalid JSON, commonly used to parse the output of LLMs
https://pypi.org/project/json-repair/
MIT License
826 stars 48 forks source link

Price like numbers not properly parsed #42

Closed GeraldWu23 closed 5 months ago

GeraldWu23 commented 5 months ago

Describe the bug Price like number not properly parsed.

To Reproduce from json_repair import repair_json repair_json("{'price': [105,000.00']}")

Expected behavior return "{'price': ['105,000.00']}" (or return "{'price': [105,000.00]}", format doesn't matter since a quote is loss)

Screenshots

image

Desktop (please complete the following information):

mangiucugna commented 5 months ago

Thanks for reporting, I will release a fix now but be advised that in this case, due to the stray ' it will be fixed a bit weirdly:

{"price": ["105,000.00", "]}"]}

GeraldWu23 commented 5 months ago

thanks, it resolves my case