chatter-0.9.1.0: A library of simple NLP algorithms.

Safe HaskellNone
LanguageHaskell2010

NLP.Corpora.Parsing

Synopsis

Documentation

readPOS :: Tag t => Text -> TaggedSentence t Source #

Read a POS-tagged corpus out of a Text string of the form: "token/tag token/tag..."

>>> readPOS "Dear/jj Sirs/nns :/: Let/vb"
[("Dear",JJ),("Sirs",NNS),(":",Other ":"),("Let",VB)]

readPOSWith :: Tag t => (Text -> t) -> Text -> TaggedSentence t Source #

safeInit :: Text -> Text Source #

Returns all but the last element of a string, unless the string is empty, in which case it returns that string.