Skip to content

Commit f5c1dc7

Browse files
committed
normalize 2nd test round
1 parent f99942e commit f5c1dc7

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/normalization/normalize.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,4 @@ def token(self) -> EaseVoiceResponse:
205205

206206
with open(self.semantic_output_path, "w", encoding="utf8") as f:
207207
f.write("\n".join(opt) + "\n")
208+
return EaseVoiceResponse(ResponseStatus.SUCCESS, "success")

src/service/normalize.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ def __init__(self, processing_path: str):
1212
def normalize(self) -> EaseVoiceResponse:
1313
try:
1414
normalize = Normalize(self.processing_path)
15-
return normalize.text()
15+
text_resp = normalize.text()
16+
if text_resp.status == ResponseStatus.FAILED:
17+
return text_resp
18+
ssl_resp = normalize.ssl()
19+
if ssl_resp.status == ResponseStatus.FAILED:
20+
return ssl_resp
21+
token_resp = normalize.token()
22+
if token_resp.status == ResponseStatus.FAILED:
23+
return token_resp
24+
return EaseVoiceResponse(ResponseStatus.SUCCESS, "Normalization completed successfully")
1625
except Exception as e:
1726
return EaseVoiceResponse(ResponseStatus.FAILED, str(e))

0 commit comments

Comments
 (0)