mirror of
https://github.com/typeable/inflections-hs.git
synced 2024-09-11 06:05:33 +03:00
Remove some qualifications
This commit is contained in:
parent
1ecd93b4b4
commit
cfffa41929
@ -3,18 +3,17 @@
|
||||
module Text.Inflections.Parse.SnakeCase ( Word(..), parser )
|
||||
where
|
||||
|
||||
import qualified Text.ParserCombinators.Parsec.Char as C
|
||||
import qualified Text.Parsec as P
|
||||
import Control.Applicative ((<$>))
|
||||
import Text.Parsec
|
||||
|
||||
import Text.Inflections.Parse.Types (Word(..))
|
||||
import Text.Inflections.Parse.Acronym (acronym)
|
||||
|
||||
word :: P.Stream s m Char => P.ParsecT s u m Word
|
||||
word = Word <$> ((P.many1 C.lower) P.<|> (P.many1 C.digit))
|
||||
word :: Stream s m Char => ParsecT s u m Word
|
||||
word = Word <$> ((many1 lower) <|> (many1 digit))
|
||||
|
||||
parser :: P.Stream s m Char => [String] -> P.ParsecT s u m [Word]
|
||||
parser :: Stream s m Char => [String] -> ParsecT s u m [Word]
|
||||
parser acronyms = do
|
||||
ws <- (acronym acronyms P.<|> word) `P.sepBy` (C.char '_')
|
||||
P.eof
|
||||
ws <- (acronym acronyms <|> word) `sepBy` (char '_')
|
||||
eof
|
||||
return ws
|
||||
|
Loading…
Reference in New Issue
Block a user