packages feed

sentiwordnet-parser 0.1.1.0 → 0.2.0.0

raw patch · 3 files changed

+10/−7 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- NLP.SentiwordnetParser: parse :: Text -> Result SentiWordNet
+ NLP.SentiwordnetParser: parse :: Text -> Either String SentiWordNet

Files

README.md view
@@ -1,4 +1,4 @@-# sentiwordnet-parser+# sentiwordnet-parser [![Build Status](https://travis-ci.org/k-bx/sentiwordnet-parser.svg?branch=master)](https://travis-ci.org/k-bx/sentiwordnet-parser)  Parser for the [SentiWordNet](http://sentiwordnet.isti.cnr.it/) tab-separated file. 
sentiwordnet-parser.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 63064a8cda681a9767f685c20005f0e6b1064bb63bcb35c21169b4a0eb432ddf+-- hash: 3fff6c8363d0c96d4c1cb3c7f659f1f158f5f21672d6142f2f4c26f88fea5ba5  name:           sentiwordnet-parser-version:        0.1.1.0+version:        0.2.0.0 synopsis:       Parser for the SentiWordNet tab-separated file description:    Parser for the SentiWordNet tab-separated file category:       Natural Language Processing
src/NLP/SentiwordnetParser.hs view
@@ -112,8 +112,11 @@ parseSentiWordNet :: Parser SentiWordNet parseSentiWordNet = SentiWordNet <$> some parseEntry -parse :: Text -> Result SentiWordNet-parse = parseString parseSentiWordNet mempty . T.unpack+parse :: Text -> Either String SentiWordNet+parse t =+  case parseString parseSentiWordNet mempty . T.unpack $ t of+    Failure e -> Left (show e)+    Success r -> Right r  data SentiWordNetLookupItem = SentiWordNetLookupItem   { lookPos :: Int@@ -140,5 +143,5 @@       "/home/kb/Downloads/SentiWordNet_3.0.0/SentiWordNet_3.0.0_20130122.txt"   let res = parse sentiWordNet   case res of-    Success r -> print (length (items r))-    Failure e -> print e+    Right r -> print (length (items r))+    Left e -> putStrLn e