Commit b2225d85 authored by Yoann HOUPERT's avatar Yoann HOUPERT

patch escaped character

parent 6737253b
Pipeline #11170 passed with stage
in 3 minutes and 15 seconds
......@@ -56,20 +56,22 @@ const routesFactory = config => {
if (json.status === 5) {
return res.status(interalServerCode).json({module: 'Offline transcription', error: 'Error during audio transcription'});
}
const transcription = JSON.parse(json.transcript).transcript;
const jsonStr = json.transcript.transcription;
const transcription = JSON.parse(json.transcript.transcription);
let jsonResponse = {};
// Depend on the offline server
try {
jsonResponse = {
status: 0,
hypotheses: JSON.parse(transcription),
hypotheses: transcription.hypotheses,
id: uuidv1()
};
} catch (err) {
jsonResponse = {
status: 0,
hypotheses: [{
utterance: transcription
utterance: jsonStr
}],
id: uuidv1()
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment