Skip to content

Commit

Permalink
chg: [description_value] reprocess clusters to avoid duplicate on value
Browse files Browse the repository at this point in the history
adulau committed Oct 13, 2023
1 parent 6f1b834 commit fe77114
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tools/description_value.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
# coding=utf-8
"""
Tool to remove duplicates in value
"""
import sys
import json

with open(sys.argv[1], 'r') as f:
data = json.load(f)

#for c in data['values']:
# c['value'] = f'{c["value"]} - {c["meta"]["description"]}'

value_seen = []
data_output = []
for c in data['values']:
if c['value'] in value_seen:
continue
else:
data_output.append(c)
value_seen.append(c['value'])

data['values'] = data_output
with open(sys.argv[1], 'w') as f:
json.dump(data, f)

0 comments on commit fe77114

Please sign in to comment.