Update app.py
Browse files
app.py
CHANGED
|
@@ -515,7 +515,22 @@ def translate_get(
|
|
| 515 |
):
|
| 516 |
return translate_post(TranslateRequest(text=text, save_sequence=save_sequence))
|
| 517 |
|
| 518 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 519 |
@app.get("/signs")
|
| 520 |
def list_signs():
|
| 521 |
return {"total": len(sign_matcher.available_signs), "signs": sign_matcher.available_signs}
|
|
|
|
| 515 |
):
|
| 516 |
return translate_post(TranslateRequest(text=text, save_sequence=save_sequence))
|
| 517 |
|
| 518 |
+
@app.get("/sign/{word}")
|
| 519 |
+
def get_single_sign(word: str):
|
| 520 |
+
match = sign_matcher.find_sign(word, word)
|
| 521 |
+
if match.found:
|
| 522 |
+
return {
|
| 523 |
+
"status": "success",
|
| 524 |
+
"word": word,
|
| 525 |
+
"identifier": match.sign_label,
|
| 526 |
+
"confidence": match.confidence,
|
| 527 |
+
"method": match.method
|
| 528 |
+
}
|
| 529 |
+
return {
|
| 530 |
+
"status": "not_found",
|
| 531 |
+
"word": word,
|
| 532 |
+
"message": "الكلمة مش موجودة — هيتم التهجئة حرف حرف"
|
| 533 |
+
}
|
| 534 |
@app.get("/signs")
|
| 535 |
def list_signs():
|
| 536 |
return {"total": len(sign_matcher.available_signs), "signs": sign_matcher.available_signs}
|