mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-18 15:29:36 +00:00
- API routers, ACA modules, integrations (draft operators) - Docs, landing pages, scripts (launch readiness, scorecard) - Tests and CI workflow updates for Dealix Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
506 B
Python
20 lines
506 B
Python
"""Lightweight Saudi-Arabic tone score — heuristic."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import re
|
|
from typing import Any
|
|
|
|
|
|
def evaluate_saudi_tone(text_ar: str) -> dict[str, Any]:
|
|
t = (text_ar or "").strip()
|
|
score = 65
|
|
if re.search(r"(هل|ممكن|نقدّم|نرحب|شاكرين)", t):
|
|
score += 10
|
|
if len(t) > 600:
|
|
score -= 10
|
|
if "!!!" in t or "؟؟؟" in t:
|
|
score -= 8
|
|
score = max(0, min(100, score))
|
|
return {"tone_score": score, "demo": True}
|