https://kotlinlang.org logo
#android
Title
# android
b

Bratislav Damnjanovic

01/23/2023, 8:31 AM
Hi all :) Has anyone come across a Kotlin/Java library for sorting that utilizes the same criteria as the one found in https://github.com/kentcdodds/match-sorter? Criteria (Ranking system): 1. CASE SENSITIVE EQUALS: Case-sensitive equality trumps all. These will be first. (ex.
France
would match
France
, but not
france
) 2. EQUALS: Case-insensitive equality (ex.
France
would match
france
) 3. STARTS WITH: If the item starts with the given value (ex.
Sou
would match
South Korea
or
South Africa
) 4. WORD STARTS WITH: If the item has multiple words, then if one of those words starts with the given value (ex.
Repub
would match
Dominican Republic
) 5. CONTAINS: If the item contains the given value (ex.
ham
would match
Bahamas
) 6. ACRONYM: If the item's acronym is the given value (ex.
us
would match
United States
)
o

Ozioma Ogbe

01/23/2023, 11:50 AM
Are these some standard criteria? If not, I think it would be better to write out the logic by yourself.
You can copy the test cases used in that library to make sure your implementation works correctly.
2 Views