fasdfsa commited on
Commit
1aaffae
·
1 Parent(s): 1a6fe57

写入 .lines

Browse files
data/ch01/out2/SWX0005_00001_00001.lines ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c279f94984ca199cba9edac41deb4bb926ab333778d70216ed43befb7613c490
3
+ size 65195
lines.py CHANGED
@@ -29,6 +29,7 @@ if __name__ == '__main__':
29
  lines = []
30
  line = []
31
  for j, pt in enumerate(boxs):
 
32
  with open(pt, "r", encoding='UTF-8') as fp:
33
  box = json.load(fp)
34
 
@@ -60,6 +61,9 @@ if __name__ == '__main__':
60
  last_x = lu[0]
61
 
62
 
63
- print(f"{box} {j+1} / {len(boxs)}")
 
 
 
64
 
65
  print(f"{chapter} {i+1} / {len(pths)}")
 
29
  lines = []
30
  line = []
31
  for j, pt in enumerate(boxs):
32
+ pt_lines = pt.replace('.boxs', '.lines')
33
  with open(pt, "r", encoding='UTF-8') as fp:
34
  box = json.load(fp)
35
 
 
61
  last_x = lu[0]
62
 
63
 
64
+ with open(pt_lines, 'w', encoding='utf-8') as fp:
65
+ json.dump(lines, fp, indent=4, ensure_ascii=False)
66
+
67
+ print(f"box {j+1} / {len(boxs)}")
68
 
69
  print(f"{chapter} {i+1} / {len(pths)}")