From cb6f6c9949775471f0c7944776d06b3d9a1ccfef Mon Sep 17 00:00:00 2001 From: Sukchan Lee Date: Sat, 9 Dec 2023 15:41:05 +0900 Subject: [PATCH] :art: Enhnace code in weight table repository --- .../speechbuddy/repository/WeightTableRepository.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/frontend/app/src/main/java/com/example/speechbuddy/repository/WeightTableRepository.kt b/frontend/app/src/main/java/com/example/speechbuddy/repository/WeightTableRepository.kt index b3fb104d..9cd4166f 100644 --- a/frontend/app/src/main/java/com/example/speechbuddy/repository/WeightTableRepository.kt +++ b/frontend/app/src/main/java/com/example/speechbuddy/repository/WeightTableRepository.kt @@ -146,7 +146,7 @@ class WeightTableRepository @Inject constructor( val listOfSymCntPairs = mutableListOf>() val weights = oneWeightRow[0].weights - for (i in 0 until allSymbolList.size) { + for (i in allSymbolList.indices) { listOfSymCntPairs.add(Pair(allSymbolList[i], weights[i])) } @@ -189,11 +189,9 @@ class WeightTableRepository @Inject constructor( val weights = targetRow.weights val preSymbolWeights = weights.toIntArray() // 앞 symbol의 weights - preSymbolWeights[dbIndex2] += 15 + preSymbolWeights[dbIndex2] += 10 - val aftSymbolWeights = preSymbolWeights - - updateWeightRow(targetRow, aftSymbolWeights.toList()) + updateWeightRow(targetRow, preSymbolWeights.toList()) } } }