1
1
mirror of https://github.com/github/semantic.git synced 2024-12-01 09:15:01 +03:00

Rename defaultMoveBound to lookaheadPlaces.

This commit is contained in:
Rob Rix 2017-10-24 12:27:07 -04:00
parent 3e03e326c0
commit a27ef1cdea

View File

@ -86,7 +86,7 @@ rws canCompare equivalent as bs
(kdMapA, kdMapB) = (toKdMap as, toKdMap bs) (kdMapA, kdMapB) = (toKdMap as, toKdMap bs)
isNearAndComparableTo :: ComparabilityRelation syntax ann1 ann2 -> Int -> Term syntax ann2 -> Int -> Term syntax ann1 -> Bool isNearAndComparableTo :: ComparabilityRelation syntax ann1 ann2 -> Int -> Term syntax ann2 -> Int -> Term syntax ann1 -> Bool
isNearAndComparableTo canCompare index term k term' = inRange (index, index + defaultMoveBound) k && canCompareTerms canCompare term' term isNearAndComparableTo canCompare index term k term' = inRange (index, index + lookaheadPlaces) k && canCompareTerms canCompare term' term
-- | Finds the most-similar term to the passed-in term, if any. -- | Finds the most-similar term to the passed-in term, if any.
-- --
@ -102,13 +102,13 @@ mostSimilarMatching isEligible tree key = listToMaybe (sortOn approximateEditDis
where candidates = filter (uncurry isEligible) (snd <$> KdMap.kNearest tree defaultL (rhead (extract key))) where candidates = filter (uncurry isEligible) (snd <$> KdMap.kNearest tree defaultL (rhead (extract key)))
approximateEditDistance = editDistanceUpTo defaultM key . snd approximateEditDistance = editDistanceUpTo defaultM key . snd
defaultD, defaultL, defaultM, defaultP, defaultQ, defaultMoveBound :: Int defaultD, defaultL, defaultM, defaultP, defaultQ, lookaheadPlaces :: Int
defaultD = 15 defaultD = 15
defaultL = 2 defaultL = 2
defaultM = 10 defaultM = 10
defaultP = 2 defaultP = 2
defaultQ = 3 defaultQ = 3
defaultMoveBound = 0 lookaheadPlaces = 0
toKdMap :: Functor syntax => [(Int, Term syntax (Record (FeatureVector ': fields)))] -> KdMap.KdMap Double FeatureVector (Int, Term syntax (Record (FeatureVector ': fields))) toKdMap :: Functor syntax => [(Int, Term syntax (Record (FeatureVector ': fields)))] -> KdMap.KdMap Double FeatureVector (Int, Term syntax (Record (FeatureVector ': fields)))