[ngrams] fix boundary chars being repeated when highlighted

parent 7c64beb4
...@@ -176,7 +176,7 @@ highlightNgrams cache@{ pm, pats } ntype table@(NgramsTable {ngrams_repo_element ...@@ -176,7 +176,7 @@ highlightNgrams cache@{ pm, pats } ntype table@(NgramsTable {ngrams_repo_element
-- , hashStructPats: hashStruct.pats }) \_ -> -- , hashStructPats: hashStruct.pats }) \_ ->
A.fromFoldable (GUT.first undb <$> unsafePartial (foldl goFold ((input /\ Nil) : Nil) ixs)) A.fromFoldable (GUT.first undb <$> unsafePartial (foldl goFold ((input /\ Nil) : Nil) ixs))
where where
spR x = " " <> R.replace wordBoundaryReg "$1$1" x <> " " spR x = " " <> R.replace wordBoundaryReg "$1 " x <> " "
-- reR = R.replace wordBoundaryReg " " -- reR = R.replace wordBoundaryReg " "
db = S.replaceAll (S.Pattern " ") (S.Replacement " ") db = S.replaceAll (S.Pattern " ") (S.Replacement " ")
-- | We need to add spaces around terms to avoid matching on -- | We need to add spaces around terms to avoid matching on
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment