continue fixing
This commit is contained in:
@@ -1208,16 +1208,29 @@ class MainActivity : Activity() {
|
||||
"{\"sentence_index\":$it}"
|
||||
}
|
||||
text("segments", payload)
|
||||
val scores = dubSegments.keys.sorted().map { index ->
|
||||
val scores = dubSegments.keys.sorted().mapNotNull { index ->
|
||||
latestScores[index]
|
||||
}.filterNotNull().joinToString(",", "[", "]") { score ->
|
||||
?.let { score -> index to score }
|
||||
}.joinToString(",", "[", "]") { (index, score) ->
|
||||
buildString {
|
||||
append("{\"sentence_index\":")
|
||||
append(score.sentenceIndex)
|
||||
append(index)
|
||||
if (score.overallScore != null) {
|
||||
append(",\"overall_score\":")
|
||||
append(score.overallScore)
|
||||
}
|
||||
listOf(
|
||||
"content_score" to score.contentScore,
|
||||
"fluency_score" to score.fluencyScore,
|
||||
"duration_score" to score.durationScore,
|
||||
"pause_score" to score.pauseScore,
|
||||
"speech_rate_score" to score.speechRateScore,
|
||||
).forEach { (name, value) ->
|
||||
value?.let {
|
||||
append(",\"$name\":")
|
||||
append(it)
|
||||
}
|
||||
}
|
||||
score.recognizedText?.let { text ->
|
||||
append(",\"recognized_text\":\"")
|
||||
append(text.replace("\\", "\\\\").replace("\"", "\\\""))
|
||||
|
||||
Reference in New Issue
Block a user