runelite-client/src/main/java/net/runelite/client/plugins/config/FuzzySearch.java
/**
	 * Calculates string occurrence bonus of query in the entry string
	 * @param entry entry string
	 * @param query query string
	 * @return string occurrence bonus
	 */
Calculates string occurrence bonus of query in the entry string
@param entry entry string
@param query query string
@return string occurrence bonus
Calculates string occurrence bonus of query in the entry string @param entry entry string @param query query string @return string occurrence bonus
private static double calculateStringOccurrenceBonus(final String entry, final String query)
	{
		if (query.length() > entry.length())
		{
			return 0;
		}
		final String relaxedEntry = entry.toLowerCase();
		final String relaxedQuery = query.toLowerCase();
		final double base = 1d / 6d;
		if (entry.equals(query))
		{
			return base * 6d;
		}
		if (entry.equals(relaxedQuery) || relaxedQuery.equals(entry))
		{
			return base * 5d;
		}
		if (relaxedEntry.equals(relaxedQuery))
		{
			return base * 4d;
		}
		if (entry.contains(query))
		{
			return base * 3d;
		}
		if (entry.contains(relaxedQuery) || relaxedEntry.contains(query))
		{
			return base * 2d;
		}
		if (relaxedEntry.contains(relaxedQuery))
		{
			return base;
		}
		return 0;
	}
private static double calculateStringOccurrenceBonus ( final String entry , final String query ) { if ( query . length ( ) > entry . length ( ) ) { return 0 ; } final String relaxedEntry = entry . toLowerCase ( ) ; final String relaxedQuery = query . toLowerCase ( ) ; final double base = 1d / 6d ; if ( entry . equals ( query ) ) { return base * 6d ; } if ( entry . equals ( relaxedQuery ) || relaxedQuery . equals ( entry ) ) { return base * 5d ; } if ( relaxedEntry . equals ( relaxedQuery ) ) { return base * 4d ; } if ( entry . contains ( query ) ) { return base * 3d ; } if ( entry . contains ( relaxedQuery ) || relaxedEntry . contains ( query ) ) { return base * 2d ; } if ( relaxedEntry . contains ( relaxedQuery ) ) { return base ; } return 0 ; }
Calculates string occurrence bonus of query in the entry string
 @param entry entry string
 @param query query string
 @return string occurrence bonus
Calculates string occurrence bonus of query in the entry string @param entry entry string @param query query string @return string occurrence bonus
// Exit early, no occurrence bonus for too long query // Create relaxed variants of the input (e.g lower cased ones) // Create base bonus