packages feed

fullstop 0.1.2 → 0.1.3.1

raw patch · 7 files changed

+86/−81 lines, 7 filesdep +fullstopdep ~basedep ~test-frameworkdep ~test-framework-hunit

Dependencies added: fullstop

Dependency ranges changed: base, test-framework, test-framework-hunit, test-framework-quickcheck2

Files

− Tests.hs
@@ -1,10 +0,0 @@-import Test.Framework-import Test.Framework.Providers.HUnit-import Test.Framework.Providers.QuickCheck2--import Tests.NLP.FullStop ( suite )--main :: IO ()-main = defaultMain-  [ Tests.NLP.FullStop.suite-  ]
− Tests/NLP/FullStop.hs
@@ -1,50 +0,0 @@-module Tests.NLP.FullStop ( suite ) where--import Data.Char ( isSpace )--import Test.HUnit-import Test.Framework-import Test.Framework.Providers.HUnit-import Test.Framework.Providers.QuickCheck2--import NLP.FullStop---- ------------------------------------------------------------------ --------------------------------------------------------------suite :: Test.Framework.Test-suite =- testGroup "NLP.FullStop"-  [ testGroup "basic sanity checking"-      [ testProperty "concat (segment s) == id s, modulo whitespace" prop_segment_concat-      ]-  , testGroup "segmentation"-     [ testCaseSegments "simple"  ["Foo.", "Bar."]   "Foo. Bar."-     , testCaseSegments "condense"  ["What?!", "Yeah"]   "What?! Yeah"-     , testCaseSegments "URLs"    ["Check out http://www.example.com.", "OK?"]-                                   "Check out http://www.example.com. OK?"-     , testCaseNoSplit "titles"    "Mr. Doe, Mrs. Durand, St. Orolo and Dr. Singh"-     , testCaseNoSplit "abbreviations"   "e.g., or eg., i.e. or ie. should not be split"-     , testCaseSegments "abbreviations 2"   ["No lie.", "Honestly"] "No lie. Honestly"-     , testCaseNoSplit "initials"  "E. Y. Kow"-     , testCaseNoSplit "initials 2"  "Hello, E. Y. Kow"-     , testCaseSegments "initials counter" [ "E. Y. Kow.", "Hello" ] "E. Y. Kow. Hello"-     , testCaseNoSplit "numbers"   "version 2.3.99.2"-     -- TODO: what's a good way of dealing with ellipsis (...)?-     -- TODO: He said "Foo." Bar (tricky because Foo. "Bar" is legit)-     -- TODO: Very likely to be cases where it's just plain ambiguous-     ]-  ]--testCaseNoSplit d x = testCaseSegments d [x] x-testCaseSegments d xs x = testCase d $ assertEqual "" xs (segment x)---- TODO: perhaps create a newtype that skews the random generation of tests--- towards things that look more like text (but not too much, because we still--- want to make sure we're covering edge-cases)--prop_segment_concat s =-   noWhite s == concatMap noWhite (segment s)- where-   noWhite = filter (not . isSpace)
fullstop.cabal view
@@ -1,5 +1,5 @@ name:                fullstop-version:             0.1.2+version:             0.1.3.1 synopsis:            Simple sentence segmenter description:         FullStop splits texts into sentences, using some orthographical                      conventions (used in English and hopefully other languages).@@ -17,35 +17,40 @@ license:             BSD3 license-file:        LICENSE author:              Eric Kow-maintainer:          Eric Kow <E.Y.Kow@brighton.ac.uk>-homepage:            http://patch-tag.com/r/kowey/fullstop-cabal-version:       >= 1.6+maintainer:          Eric Kow <kowey@comp-ling.com>+homepage:            http://hub.darcs.net/kowey/fullstop+cabal-version:       >= 1.10 build-type:          Custom -flag test-     Description: Build the test suite-     Default: False+source-repository head+  type:     darcs+  location: http://hub.darcs.net/kowey/fullstop  library     exposed-modules:  NLP.FullStop      -- NB: there actualy isn't any particular need for GHC 6.10-    build-Depends: base >= 3 && < 4.3+    build-Depends: base >= 3 && < 5                  , split == 0.1.*+    default-language: Haskell98  executable fullstop     main-is:  fullstop.hs+    build-Depends: base+                 , fullstop+    hs-source-dirs:  fullstop+    default-language: Haskell98 -executable hstest-fullstop+test-suite hstest-fullstop+  type:            exitcode-stdio-1.0+  hs-source-dirs:  test   main-is:         Tests.hs   other-modules:   Tests.NLP.FullStop -  if flag(test)-    build-depends:   base >= 3 && < 4.3-                 ,   HUnit == 1.2.*-                 ,   QuickCheck == 2.4.*-                 ,   test-framework       == 0.3.*-                 ,   test-framework-hunit == 0.2.*-                 ,   test-framework-quickcheck2 == 0.2.*-  else-    Buildable: False+  build-depends:   base+               ,   fullstop+               ,   HUnit == 1.2.*+               ,   QuickCheck == 2.4.*+               ,   test-framework+               ,   test-framework-hunit+               ,   test-framework-quickcheck2
− fullstop.hs
@@ -1,3 +0,0 @@-import NLP.FullStop--main = interact (unlines . segment)
+ fullstop/fullstop.hs view
@@ -0,0 +1,3 @@+import NLP.FullStop++main = interact (unlines . segment)
+ test/Tests.hs view
@@ -0,0 +1,10 @@+import Test.Framework+import Test.Framework.Providers.HUnit+import Test.Framework.Providers.QuickCheck2++import Tests.NLP.FullStop ( suite )++main :: IO ()+main = defaultMain+  [ Tests.NLP.FullStop.suite+  ]
+ test/Tests/NLP/FullStop.hs view
@@ -0,0 +1,50 @@+module Tests.NLP.FullStop ( suite ) where++import Data.Char ( isSpace )++import Test.HUnit+import Test.Framework+import Test.Framework.Providers.HUnit+import Test.Framework.Providers.QuickCheck2++import NLP.FullStop++-- ------------------------------------------------------------+--+-- ------------------------------------------------------------++suite :: Test.Framework.Test+suite =+ testGroup "NLP.FullStop"+  [ testGroup "basic sanity checking"+      [ testProperty "concat (segment s) == id s, modulo whitespace" prop_segment_concat+      ]+  , testGroup "segmentation"+     [ testCaseSegments "simple"  ["Foo.", "Bar."]   "Foo. Bar."+     , testCaseSegments "condense"  ["What?!", "Yeah"]   "What?! Yeah"+     , testCaseSegments "URLs"    ["Check out http://www.example.com.", "OK?"]+                                   "Check out http://www.example.com. OK?"+     , testCaseNoSplit "titles"    "Mr. Doe, Mrs. Durand, St. Orolo and Dr. Singh"+     , testCaseNoSplit "abbreviations"   "e.g., or eg., i.e. or ie. should not be split"+     , testCaseSegments "abbreviations 2"   ["No lie.", "Honestly"] "No lie. Honestly"+     , testCaseNoSplit "initials"  "E. Y. Kow"+     , testCaseNoSplit "initials 2"  "Hello, E. Y. Kow"+     , testCaseSegments "initials counter" [ "E. Y. Kow.", "Hello" ] "E. Y. Kow. Hello"+     , testCaseNoSplit "numbers"   "version 2.3.99.2"+     -- TODO: what's a good way of dealing with ellipsis (...)?+     -- TODO: He said "Foo." Bar (tricky because Foo. "Bar" is legit)+     -- TODO: Very likely to be cases where it's just plain ambiguous+     ]+  ]++testCaseNoSplit d x = testCaseSegments d [x] x+testCaseSegments d xs x = testCase d $ assertEqual "" xs (segment x)++-- TODO: perhaps create a newtype that skews the random generation of tests+-- towards things that look more like text (but not too much, because we still+-- want to make sure we're covering edge-cases)++prop_segment_concat s =+   noWhite s == concatMap noWhite (segment s)+ where+   noWhite = filter (not . isSpace)