| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Circuit.Parser.Token
Synopsis
- tokenize :: Text -> [Text]
- tokenizeLoop :: String -> [String] -> [String]
- lowerLetter :: Uncons f Char => Parser Identity f Char Char
- upperLetter :: Uncons f Char => Parser Identity f Char Char
- letter :: Uncons f Char => Parser Identity f Char Char
- digit :: Uncons f Char => Parser Identity f Char Char
- word :: Uncons f Char => Parser Identity f Char [Char]
- number :: Uncons f Char => Parser Identity f Char [Char]
- punctuation :: Uncons f Char => Parser Identity f Char Char
- token :: Uncons f Char => Parser Identity f Char [Char]
- data Vocabulary = Vocabulary {
- vocabTokenToIndex :: !(Map Text Int)
- vocabIndexToToken :: !(IntMap Text)
- vocabSize :: !Int
- buildVocabulary :: [Text] -> Vocabulary
- lookupIndex :: Text -> Vocabulary -> Maybe Int
- lookupToken :: Int -> Vocabulary -> Maybe Text
- vocabularySize :: Vocabulary -> Int
- filterVocabulary :: (Text -> Bool) -> Vocabulary -> Vocabulary
- takeTopN :: Int -> Vocabulary -> Vocabulary
Documentation
tokenize :: Text -> [Text] Source #
Tokenize text into a list of tokens using Circuit.Parser patterns.
data Vocabulary Source #
Constructors
| Vocabulary | |
Fields
| |
Instances
| Eq Vocabulary Source # | |
Defined in Circuit.Parser.Token | |
| Show Vocabulary Source # | |
Defined in Circuit.Parser.Token Methods showsPrec :: Int -> Vocabulary -> ShowS # show :: Vocabulary -> String # showList :: [Vocabulary] -> ShowS # | |
buildVocabulary :: [Text] -> Vocabulary Source #
lookupIndex :: Text -> Vocabulary -> Maybe Int Source #
lookupToken :: Int -> Vocabulary -> Maybe Text Source #
vocabularySize :: Vocabulary -> Int Source #
filterVocabulary :: (Text -> Bool) -> Vocabulary -> Vocabulary Source #
takeTopN :: Int -> Vocabulary -> Vocabulary Source #