app/src/main/java/fr/neamar/kiss/dataprovider/AppProvider.java
/**
     * @param query    The string to search for
     * @param searcher The receiver of results
     */
@param query    The string to search for
@param searcher The receiver of results
@param query The string to search for @param searcher The receiver of results
@Override
    public void requestResults(String query, Searcher searcher) {
        StringNormalizer.Result queryNormalized = StringNormalizer.normalizeWithResult(query, false);
        if (queryNormalized.codePoints.length == 0) {
            return;
        }
        FuzzyScore fuzzyScore = new FuzzyScore(queryNormalized.codePoints);
        FuzzyScore.MatchInfo matchInfo;
        boolean match;
        for (AppPojo pojo : pojos) {
            if(pojo.isExcluded()) {
                continue;
            }
            matchInfo = fuzzyScore.match(pojo.normalizedName.codePoints);
            match = matchInfo.match;
            pojo.relevance = matchInfo.score;
            if (pojo.getNormalizedTags() != null) {
                matchInfo = fuzzyScore.match(pojo.getNormalizedTags().codePoints);
                if (matchInfo.match && (!match || matchInfo.score > pojo.relevance)) {
                    match = true;
                    pojo.relevance = matchInfo.score;
                }
            }
            if (match && !searcher.addResult(pojo)) {
                return;
            }
        }
    }
@ Override public void requestResults ( String query , Searcher searcher ) { StringNormalizer . Result queryNormalized = StringNormalizer . normalizeWithResult ( query , false ) ; if ( queryNormalized . codePoints . length == 0 ) { return ; } FuzzyScore fuzzyScore = new FuzzyScore ( queryNormalized . codePoints ) ; FuzzyScore . MatchInfo matchInfo ; boolean match ; for ( AppPojo pojo : pojos ) { if ( pojo . isExcluded ( ) ) { continue ; } matchInfo = fuzzyScore . match ( pojo . normalizedName . codePoints ) ; match = matchInfo . match ; pojo . relevance = matchInfo . score ; if ( pojo . getNormalizedTags ( ) != null ) { matchInfo = fuzzyScore . match ( pojo . getNormalizedTags ( ) . codePoints ) ; if ( matchInfo . match && ( ! match || matchInfo . score > pojo . relevance ) ) { match = true ; pojo . relevance = matchInfo . score ; } } if ( match && ! searcher . addResult ( pojo ) ) { return ; } } }
@param query    The string to search for
 @param searcher The receiver of results
@param query The string to search for @param searcher The receiver of results
// check relevance for tags