1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 05:11:44 +03:00

Place the index last.

This commit is contained in:
Rob Rix 2016-06-29 10:06:35 -04:00
parent 5cb8d1ddc6
commit b2003de8d4

View File

@ -36,11 +36,11 @@ rws compare getLabel as bs
mapped <- get
let ((k, nearest), j) = KdTree.nearest kdas kv
if k `Set.member` mapped
then pure (j, insert v)
then pure (insert v, j)
else do
put (Set.insert k mapped)
pure $! maybe (j, replace nearest v) ((,) j) (compare nearest v)
deleteRemaining diff mapped = fmap snd diff <> (delete . snd . fst <$> filter (not . (`Set.member` mapped) . fst . fst) fas)
pure $! maybe (replace nearest v, j) (flip (,) j) (compare nearest v)
deleteRemaining diff mapped = fmap fst diff <> (delete . snd . fst <$> filter (not . (`Set.member` mapped) . fst . fst) fas)
data Gram label = Gram { stem :: [Maybe label], base :: [Maybe label] }
deriving (Eq, Show)