Commit bb111ffe authored by yu's avatar yu

1

parent 4eb9a32d
...@@ -767,16 +767,15 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -767,16 +767,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
}) })
} }
private checkWords(data) { private checkWords(data) {
let words = data.result.words; const sentences = data.result.sentences;
let isSuccess = true; for (let i = 0; i < sentences.length; i++) {
for (const key in words) { const details = sentences[i].details;
if (Object.prototype.hasOwnProperty.call(words, key)) { const isSuccess = details.some(item => item.overall <= 40);
const element = words[key]; if (isSuccess) {
this.log("score: " + element.scores.overall); return false;
if (element.scores.overall <= 40) return isSuccess = false;
} }
} }
return isSuccess; return true;
} }
} }
......
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