Issue #1000
This commit is contained in:
25
issue1000/step0.py
Normal file
25
issue1000/step0.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import sys
|
||||
import json
|
||||
|
||||
FILE_OUT2D = sys.argv[1]
|
||||
C2 = sys.argv[2]
|
||||
FILE_OUT = sys.argv[3]
|
||||
|
||||
data_out = {}
|
||||
|
||||
with open(FILE_OUT2D, 'r') as fp:
|
||||
for line in fp:
|
||||
cells = line.split(", ")
|
||||
|
||||
lemma1 = cells[1]
|
||||
lemma2 = cells[1 + int(C2) * 5]
|
||||
rep = cells[-7]
|
||||
freq = cells[-6]
|
||||
fd = cells[-1]
|
||||
cid = cells[-8]
|
||||
|
||||
data_out[cid] = [lemma1, lemma2, rep, freq, fd, cid]
|
||||
|
||||
with open(FILE_OUT, 'w') as fp:
|
||||
json.dump(data_out, fp)
|
||||
|
||||
Reference in New Issue
Block a user