Skip to content

Commit

Permalink
refactor: #118-발음평가 JSON 문장 순서기준 단어 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueBerrySoda committed May 1, 2024
1 parent e0d3f7d commit 9ba12ef
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,16 +203,18 @@ else if (e.getResult().getReason() == ResultReason.NoMatch) {
responseJson.put("paragraphCompleteness", completenessScore);
responseJson.put("paragraphFluency", fluencyScore);

Map<String, Object> subWord = new HashMap<>();
List<Map<String, Object>> subWord = new ArrayList<>();

for (Word w : finalWords) {
System.out.println(" word: " + w.word + "\taccuracy score: " +
w.accuracyScore + "\terror type: " + w.errorType);
subWord.put(w.word, Map.of(
"accuracy", w.accuracyScore,
"errorType", w.errorType));
subWord.add(Map.of(
"word", w.word,
"errorType", w.errorType,
"accuracy", w.accuracyScore
));
}
responseJson.put("word", subWord);
responseJson.put("wordList", subWord);
}
speechConfig.close();
audioConfig.close();
Expand Down

0 comments on commit 9ba12ef

Please sign in to comment.