@Test public void testNormConfidence() throws Exception { assertEquals(0, NubMatchingServiceImpl.normConfidence(0)); assertEquals(0, NubMatchingServiceImpl.normConfidence(-1)); assertEquals(0, NubMatchingServiceImpl.normConfidence(-10000)); assertEquals(1, NubMatchingServiceImpl.normConfidence(1)); assertEquals(10, NubMatchingServiceImpl.normConfidence(10)); assertEquals(20, NubMatchingServiceImpl.normConfidence(20)); assertEquals(30, NubMatchingServiceImpl.normConfidence(30)); assertEquals(50, NubMatchingServiceImpl.normConfidence(50)); assertEquals(60, NubMatchingServiceImpl.normConfidence(60)); assertEquals(70, NubMatchingServiceImpl.normConfidence(70)); assertEquals(80, NubMatchingServiceImpl.normConfidence(80)); assertEquals(85, NubMatchingServiceImpl.normConfidence(85)); assertEquals(88, NubMatchingServiceImpl.normConfidence(90)); assertEquals(89, NubMatchingServiceImpl.normConfidence(92)); assertEquals(91, NubMatchingServiceImpl.normConfidence(95)); assertEquals(92, NubMatchingServiceImpl.normConfidence(98)); assertEquals(92, NubMatchingServiceImpl.normConfidence(99)); assertEquals(93, NubMatchingServiceImpl.normConfidence(100)); assertEquals(95, NubMatchingServiceImpl.normConfidence(105)); assertEquals(96, NubMatchingServiceImpl.normConfidence(110)); assertEquals(97, NubMatchingServiceImpl.normConfidence(115)); assertEquals(99, NubMatchingServiceImpl.normConfidence(120)); assertEquals(100, NubMatchingServiceImpl.normConfidence(125)); assertEquals(100, NubMatchingServiceImpl.normConfidence(130)); assertEquals(100, NubMatchingServiceImpl.normConfidence(150)); assertEquals(100, NubMatchingServiceImpl.normConfidence(175)); assertEquals(100, NubMatchingServiceImpl.normConfidence(200)); assertEquals(100, NubMatchingServiceImpl.normConfidence(1000)); }
@VisibleForTesting protected static int normConfidence(int s) { return minMax(0, 100, s <= 80 ? s : (int) Math.round(75.8 + (26d * (Math.log10((s - 70d) * 1.5) - 1)))); }
NubMatchingServiceImpl implements NameUsageMatchingService, NameUsageMatchingService2 { @VisibleForTesting protected static int normConfidence(int s) { return minMax(0, 100, s <= 80 ? s : (int) Math.round(75.8 + (26d * (Math.log10((s - 70d) * 1.5) - 1)))); } }
NubMatchingServiceImpl implements NameUsageMatchingService, NameUsageMatchingService2 { @VisibleForTesting protected static int normConfidence(int s) { return minMax(0, 100, s <= 80 ? s : (int) Math.round(75.8 + (26d * (Math.log10((s - 70d) * 1.5) - 1)))); } @Inject  NubMatchingServiceImpl(NubIndex nubIndex, HigherTaxaComparator htComp, NameParser parser); }
NubMatchingServiceImpl implements NameUsageMatchingService, NameUsageMatchingService2 { @VisibleForTesting protected static int normConfidence(int s) { return minMax(0, 100, s <= 80 ? s : (int) Math.round(75.8 + (26d * (Math.log10((s - 70d) * 1.5) - 1)))); } @Inject  NubMatchingServiceImpl(NubIndex nubIndex, HigherTaxaComparator htComp, NameParser parser); NameUsageMatch2 v2(NameUsageMatch m); @Override NameUsageMatch match(String scientificName, @Nullable Rank rank, @Nullable LinneanClassification classification, boolean strict, boolean verbose); }
NubMatchingServiceImpl implements NameUsageMatchingService, NameUsageMatchingService2 { @VisibleForTesting protected static int normConfidence(int s) { return minMax(0, 100, s <= 80 ? s : (int) Math.round(75.8 + (26d * (Math.log10((s - 70d) * 1.5) - 1)))); } @Inject  NubMatchingServiceImpl(NubIndex nubIndex, HigherTaxaComparator htComp, NameParser parser); NameUsageMatch2 v2(NameUsageMatch m); @Override NameUsageMatch match(String scientificName, @Nullable Rank rank, @Nullable LinneanClassification classification, boolean strict, boolean verbose); static final Map<TaxonomicStatus, Integer> STATUS_SCORE; }