Skip to content

Commit

Permalink
Fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
sdercolin committed Feb 16, 2024
1 parent 7ed1431 commit 3fb0050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jsMain/kotlin/process/phonemes/PhonemesMapping.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ data class PhonemesMappingRequest(
}.sortedWith { a, b ->
val countA = a.first.split(" ").count()
val countB = b.first.split(" ").count()
if (countA != countB) return@sortedWith countB - countA // descending order
a.first.length - b.first.length
if (countA != countB) return@sortedWith countB - countA // descending order of phonemes count
b.first.length - a.first.length // descending order of the length
}

companion object {
Expand Down

0 comments on commit 3fb0050

Please sign in to comment.