DefaultQueryFilter

class DefaultQueryFilter<T>(transliterator: StreamTransliterator = DefaultStreamTransliterator(), target: (T) -> String) : QueryFilter<T>

Default implementation of QueryFilter.

This implementation of QueryFilter ignores upper case, diacritics It uses levenshtein approximation so typos are included in the search.

It is possible to choose a transliteration by providing a transliterator.

Parameters

transliterator

The transliterator to use for transliterating the query string.

target

The function to extract the target string from the item.

Constructors

Link copied to clipboard
constructor(transliterator: StreamTransliterator = DefaultStreamTransliterator(), target: (T) -> String)

Functions

Link copied to clipboard
open override fun filter(items: List<T>, query: String): List<T>

Filters the given items based on the query.