mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-26 17:34:17 +01:00
Fix search similarity average
This commit is contained in:
parent
2e76fbe4b6
commit
d225bc9bef
@ -76,7 +76,7 @@ class GenericAdapter : RecyclerView.Adapter<GenericViewHolder<ViewBinding>>(), F
|
|||||||
*/
|
*/
|
||||||
fun extractSorted() = allItems.mapNotNull { item ->
|
fun extractSorted() = allItems.mapNotNull { item ->
|
||||||
item.key().toLowerCase(Locale.getDefault()).let {
|
item.key().toLowerCase(Locale.getDefault()).let {
|
||||||
val similarity = (jw.similarity(currentSearchTerm, it)) + cos.similarity(currentSearchTerm, it) / 2
|
val similarity = (jw.similarity(currentSearchTerm, it) + cos.similarity(currentSearchTerm, it)) / 2
|
||||||
if (similarity != 0.0) ScoredItem(similarity, item) else null
|
if (similarity != 0.0) ScoredItem(similarity, item) else null
|
||||||
}
|
}
|
||||||
}.apply {
|
}.apply {
|
||||||
|
Loading…
Reference in New Issue
Block a user