mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(search) Remove dead file
This commit is contained in:
parent
9044518be5
commit
f51ba63742
@ -1,34 +0,0 @@
|
|||||||
package nu.marginalia.search.model;
|
|
||||||
|
|
||||||
import java.util.TreeMap;
|
|
||||||
|
|
||||||
public class SearchRankingSymbols {
|
|
||||||
|
|
||||||
private static final TreeMap<Double, RankingSymbol> symbols;
|
|
||||||
static {
|
|
||||||
symbols = new TreeMap<>();
|
|
||||||
symbols.put(1.0, new RankingSymbol("Ⓐ", "Fits search terms very well"));
|
|
||||||
symbols.put(3.0, new RankingSymbol("Ⓑ", "Fits search terms decently"));
|
|
||||||
symbols.put(4.0, new RankingSymbol("Ⓒ", "Could fit search terms"));
|
|
||||||
symbols.put(5.0, new RankingSymbol("Ⓓ", "Poor fit for search terms, grasping at straws"));
|
|
||||||
symbols.put(100., new RankingSymbol("Ⓕ", "Poor fit for search terms, grasping at straws"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getRankingSymbol(double termScore) {
|
|
||||||
return forScore(termScore).symbol;
|
|
||||||
}
|
|
||||||
public static String getRankingSymbolDescription(double termScore) {
|
|
||||||
return forScore(termScore).description;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static RankingSymbol forScore(double score) {
|
|
||||||
var e = symbols.ceilingEntry(score);
|
|
||||||
if (e == null) {
|
|
||||||
e = symbols.lastEntry();
|
|
||||||
}
|
|
||||||
return e.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
private record RankingSymbol(String symbol, String description) {
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user