[NGRAMS] improve the highlighter casing

parent f0a7e136
...@@ -239,11 +239,13 @@ highlightNgrams (NgramsTable table) input0 = ...@@ -239,11 +239,13 @@ highlightNgrams (NgramsTable table) input0 =
Nothing -> Nothing ->
crashWith "highlightNgrams: pattern missing from table" crashWith "highlightNgrams: pattern missing from table"
Just (NgramsElement ne) -> Just (NgramsElement ne) ->
let s1 = S.splitAt (i - i0) s in let s1 = S.splitAt (i - i0) s
s2 = S.splitAt lpat s1.after in
-- s2.before and pat might differ by casing only!
{ i0: i + lpat { i0: i + lpat
, s: S.drop lpat s1.after , s: s2.after
, l: Tuple " " Nothing : , l: Tuple " " Nothing :
Tuple pat (Just ne.list) : Tuple s2.before (Just ne.list) :
Tuple " " Nothing : Tuple " " Nothing :
consNonEmpty (unsp s1.before) l consNonEmpty (unsp s1.before) l
} }
......
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