28 lines
697 B
Python
28 lines
697 B
Python
#!/usr/bin/env python3
|
|
"""판례 JSONL 스키마와 사건번호/출처 중복을 검증한다."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import argparse
|
|
import json
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
if __package__ in (None, ""):
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
|
|
|
|
from app.engine.legal_risk import load_precedents
|
|
|
|
|
|
def main() -> int:
|
|
p = argparse.ArgumentParser(description=__doc__)
|
|
p.add_argument("jsonl", type=Path)
|
|
args = p.parse_args()
|
|
precedents = load_precedents(args.jsonl)
|
|
print(json.dumps({"valid": True, "precedent_count": len(precedents)}, ensure_ascii=False))
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|