bayan-api / debug_pipeline.py
Bayan AI
Fix: TerminalPunctuationGuard for short phrases and comprehensive Nasb/Jazm grammar rules fixes
31a6db1
Raw
History Blame Contribute Delete
681 Bytes
import sys
from pathlib import Path
# Add src to python path
sys.path.insert(0, str(Path(r'c:\Users\dell\PycharmProjects\JupyterProject1\PythonProject\BAYAN\src')))
from app import app
import json
client = app.test_client()
def test(text):
print(f"\n--- Testing: {text} ---")
resp = client.post('/api/analyze', json={'text': text})
data = resp.get_json()
if 'suggestions' in data:
for s in data['suggestions']:
print(f"[{s['type'].upper()}] '{s['original']}' -> '{s['correction']}'")
else:
print("Error:", data)
test("ذهبت المهندسون الي العمل")
test("ذهبت المهندسون")
test("الي العمل")