-- If no matches, we still need the search to continue, because the
-- result might be interesting even if it is not entirely composed of
+ -- However, we don't want to add this 'boring' item if there are
+ -- 'interesting' alternatives. Since we have already calculated
+ -- subcombos, we can find out if there are interesting combos.
+ -- We check all 'tails' of digits for something interesting,
+ -- excluding the full string.
+ case Map.lookup w cache of
+ Just ms -> any interesting ms
+ || (not $ null $ findWords w tree)
combineParts :: [Segment] -> ([Combo], Cache) -> ([Combo], Cache)
+-- TODO - fix 07956121485 - need to cache parts like '56121' to avoid boring outputs