grosenthal commited on
Commit
b424351
·
1 Parent(s): 91b09b3

add all models

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -291,6 +291,23 @@ async def translate_morph_simplified_http(text: Optional[str] = None):
291
  else:
292
  return json.dumps({"error": "Missing required parameter 'text'"}), 400
293
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
 
295
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
296
 
 
291
  else:
292
  return json.dumps({"error": "Missing required parameter 'text'"}), 400
293
 
294
+ @app.get('/translate_all/')
295
+ async def translate_all(text: Optional[str] = None):
296
+ if text is not None:
297
+ base_result = translate_base(text)
298
+ case_result = translate_case(process_line_case(text))
299
+ morph_result = translate_morph(process_line_morph(text))
300
+ morph_simplified_result = translate_morph_simplified(process_line_morph_simplified(text))
301
+
302
+ return json.dumps({
303
+ 'original': base_result,
304
+ 'case': case_result,
305
+ 'morph': morph_result,
306
+ 'morph_simplifed': morph_simplified_result
307
+ })
308
+ else:
309
+ return json.dumps({"error": "Missing required parameter 'text'"}), 400
310
+
311
 
312
  app.mount("/", StaticFiles(directory="static", html=True), name="static")
313