28 lines
625 B
Python
28 lines
625 B
Python
#!/usr/bin/env python3
|
|
|
|
import json
|
|
import sys
|
|
import pathlib
|
|
|
|
# Add scripts to path
|
|
SCRIPT_DIR = pathlib.Path(__file__).parent
|
|
sys.path.insert(0, str(SCRIPT_DIR / "scripts"))
|
|
|
|
from InflectionProcessor import InflectionProcessor
|
|
|
|
# Load the sample
|
|
with open('samples/umwehen.json', 'r', encoding='utf-8') as f:
|
|
entry = json.load(f)
|
|
|
|
print("Original entry:")
|
|
print(json.dumps(entry, ensure_ascii=False, indent=2))
|
|
|
|
# Process
|
|
processor = InflectionProcessor()
|
|
processed = processor.process(entry)
|
|
|
|
print("\nProcessed entry:")
|
|
print(json.dumps(processed, ensure_ascii=False, indent=2))
|
|
|
|
print(f"\nStats: {processor.stats}")
|