File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
benchmarks/haskell/Benchmarks/Programs Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ module Benchmarks.Programs.BigTable
13
13
14
14
import Test.Tasty.Bench (Benchmark , bench , whnfIO )
15
15
#if !MIN_VERSION_base(4,8,0)
16
- import Data.Monoid (mconcat , mempty )
16
+ import Data.Monoid (mconcat , mempty , mappend )
17
17
#endif
18
18
import Data.Text.Lazy.Builder (Builder , fromText , toLazyText )
19
19
import Data.Text.Lazy.IO (hPutStr )
Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ t_toTitle_title t = all (<= 1) (caps w)
110
110
where caps = fmap (T. length . T. filter isUpper) . T. words . T. toTitle
111
111
-- TIL: there exist uppercase-only letters
112
112
w = T. filter (\ c -> if C. isUpper c then C. toLower c /= c else True ) t
113
- t_toTitle_1stNotLower = and . notLow . T. toTitle . T. filter stable
113
+ t_toTitle_1stNotLower = and . notLow . T. toTitle . T. filter stable . T. filter ( not . isGeorgian)
114
114
where notLow = mapMaybe (fmap (not . isLower) . (T. find isLetter)) . T. words
115
115
-- Surprise! The Spanish/Portuguese ordinal indicators changed
116
116
-- from category Ll (letter, lowercase) to Lo (letter, other)
@@ -119,6 +119,9 @@ t_toTitle_1stNotLower = and . notLow . T.toTitle . T.filter stable
119
119
stable c = if isLower c
120
120
then C. toUpper c /= c
121
121
else c /= '\ 170 ' && c /= '\ 186 '
122
+ -- Georgian text does not have a concept of title case
123
+ -- https://en.wikipedia.org/wiki/Georgian_Extended
124
+ isGeorgian c = c >= '\ 4256 ' && c < '\ 4352 '
122
125
123
126
justifyLeft k c xs = xs ++ L. replicate (k - length xs) c
124
127
justifyRight m n xs = L. replicate (m - length xs) n ++ xs
You can’t perform that action at this time.
0 commit comments