iiegn commited on
Commit
8fe2f7a
·
verified ·
1 Parent(s): 8eb92fa

Feat: Use metadata-VER.json

Browse files
tools/02_traverse_ud_repos.py CHANGED
@@ -257,7 +257,7 @@ if __name__ == '__main__':
257
  # print('---')
258
 
259
  # Write the metadata to json
260
- output_fn = 'metadata.json'
261
  if args.override or not open(output_fn, 'r').read():
262
  with open(output_fn, 'w') as fh:
263
  json.dump(results, fh, ensure_ascii=False)
 
257
  # print('---')
258
 
259
  # Write the metadata to json
260
+ output_fn = f"metadata-{UD_VER}.json"
261
  if args.override or not open(output_fn, 'r').read():
262
  with open(output_fn, 'w') as fh:
263
  json.dump(results, fh, ensure_ascii=False)
tools/03_fill_universal_dependencies_tamplate.py CHANGED
@@ -45,19 +45,19 @@ if __name__ == '__main__':
45
  basepath = Path(__file__).parent.relative_to(Path.cwd())
46
 
47
  # Read the metadata from json
48
- with Path(basepath, 'metadata.json').open(mode='r') as fh:
49
  metadata = json.load(fh)
50
 
51
- with Path(basepath, f'etc/description-{UD_VER}').open(mode='r') as fh:
52
  description = (fh.read()).strip()
53
 
54
- with Path(basepath, f'etc/citation-{UD_VER}').open(mode='r') as fh:
55
  citation = (fh.read()).strip()
56
 
57
  templates = {
58
- Path(basepath, "templates/universal_dependencies.tmpl"):
59
  Path(basepath, f"universal_dependencies-{UD_VER}"),
60
- Path(basepath, "templates/README.tmpl"):
61
  Path(basepath, f"README-{UD_VER}"),
62
  }
63
  for template_fn, output_fn in templates.items():
 
45
  basepath = Path(__file__).parent.relative_to(Path.cwd())
46
 
47
  # Read the metadata from json
48
+ with Path(basepath, f"metadata-{UD_VER}.json").open(mode='r') as fh:
49
  metadata = json.load(fh)
50
 
51
+ with Path(basepath, "etc", f"description-{UD_VER}").open(mode='r') as fh:
52
  description = (fh.read()).strip()
53
 
54
+ with Path(basepath, "etc", f"citation-{UD_VER}").open(mode='r') as fh:
55
  citation = (fh.read()).strip()
56
 
57
  templates = {
58
+ Path(basepath, "templates", "universal_dependencies.tmpl"):
59
  Path(basepath, f"universal_dependencies-{UD_VER}"),
60
+ Path(basepath, "templates", "README.tmpl"):
61
  Path(basepath, f"README-{UD_VER}"),
62
  }
63
  for template_fn, output_fn in templates.items():