MCPcopy Create free account
hub / github.com/FlyingFeather/DEA-SQL / parse_json

Method parse_json

get_ner.py:44–56  ·  view source on GitHub ↗
(self, input_str)

Source from the content-addressed store, hash-verified

42 return result
43
44 def parse_json(self, input_str):
45 res = {}
46 try:
47 pattern = r"\{.*?\}"
48 match = re.search(pattern, input_str)
49 if match:
50 res = eval(match.group())
51 except:
52 try:
53 res = self.parse_custom_string(input_str)
54 except Exception as e:
55 print(f"=========eval fail==========={e}", exc_info=True)
56 return res
57
58 def run(self, query, dataset):
59 """

Callers 1

runMethod · 0.95

Calls 1

parse_custom_stringMethod · 0.95

Tested by

no test coverage detected