Ellie5757575757 commited on
Commit
cda796a
·
verified ·
1 Parent(s): d6c3048

Update cha_json.py

Browse files
Files changed (1) hide show
  1. cha_json.py +5 -0
cha_json.py CHANGED
@@ -298,6 +298,11 @@ def parse_args():
298
  p.add_argument("--output", "-o", type=str, required=True, help="輸出 .json 檔")
299
  return p.parse_args()
300
 
 
 
 
 
 
301
  def main():
302
  args = parse_args()
303
  in_path = Path(args.input)
 
298
  p.add_argument("--output", "-o", type=str, required=True, help="輸出 .json 檔")
299
  return p.parse_args()
300
 
301
+ def cha_to_json_path(cha_path: str, output_json: str | None = None) -> str:
302
+ """Backward-compatible alias for old code."""
303
+ out, _ = cha_to_json_file(cha_path, output_json=output_json)
304
+ return out
305
+
306
  def main():
307
  args = parse_args()
308
  in_path = Path(args.input)