mirror of
https://github.com/typeable/inflections-hs.git
synced 2024-09-11 06:05:33 +03:00
Minor cosmetic corrections
This commit is contained in:
parent
5b718ca4f3
commit
f3cdc38874
@ -47,5 +47,5 @@ camelizeCustom
|
||||
-> Text -- ^ The camelized 'Text'
|
||||
camelizeCustom _ [] = ""
|
||||
camelizeCustom c (x:xs) = T.concat $
|
||||
(mapWord (if c then T.toTitle else T.toLower) x) : (mapWord T.toTitle <$> xs)
|
||||
mapWord (if c then T.toTitle else T.toLower) x : (mapWord T.toTitle <$> xs)
|
||||
{-# INLINE camelizeCustom #-}
|
||||
|
@ -38,7 +38,7 @@ parameterizeCustom :: Transliterations -> Text -> Text
|
||||
parameterizeCustom m txt = (T.intercalate "-" . T.words) (T.unfoldr f ("", txt))
|
||||
where
|
||||
f ("", t) = uncurry g <$> T.uncons t
|
||||
f ((x:xs), t) = Just (x, (xs, t))
|
||||
f (x:xs, t) = Just (x, (xs, t))
|
||||
g x xs
|
||||
| (isAscii x && isAlphaNum x) || x == '_' = (toLower x, ("", xs))
|
||||
| isPunctuation x = (' ', ("", xs))
|
||||
|
@ -45,7 +45,7 @@ transliterateCustom
|
||||
transliterateCustom replacement m txt = T.unfoldr f ("", txt)
|
||||
where
|
||||
f ("", t) = uncurry g <$> T.uncons t
|
||||
f ((x:xs), t) = Just (x, (xs, t))
|
||||
f (x:xs, t) = Just (x, (xs, t))
|
||||
g x xs =
|
||||
if isAscii x
|
||||
then (x, ("", xs))
|
||||
|
Loading…
Reference in New Issue
Block a user