packages feed

edit-distance-vector 1.0.0.1 → 1.0.0.2

raw patch · 5 files changed

+17/−13 lines, 5 filesdep ~basePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: base

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+edit-distance-vector 1.0.0.2++    * Relax version bounds to support GHC 7.6.3 and 7.4.2+ edit-distance-vector 1.0.0.1      * Relax version bounds to support GHC 7.10.1.
README.md view
@@ -20,6 +20,9 @@ cabal install edit-distance-vector ```` +`edit-distance-vector` is [automatically tested][status] on GHC versions 7.4.2,+7.6.3, 7.8.3, and 7.10.1 using the Travis CI service.+ Usage ----- 
edit-distance-vector.cabal view
@@ -1,5 +1,5 @@ name:                edit-distance-vector-version:             1.0.0.1+version:             1.0.0.2 synopsis:            Calculate edit distances and edit scripts between vectors. description:   An implementation of the Wagner–Fischer dynamic programming algorithm to@@ -36,7 +36,7 @@   exposed-modules:       Data.Vector.Distance   build-depends:-      base >=4.7 && <4.9+      base >=4.5 && <4.9     , vector >= 0.8  test-suite             properties
lib/Data/Vector/Distance.hs view
@@ -161,6 +161,6 @@     delete     i c    = ("delete", i, c)     insert     i c    = ("insert", i, c)     substitute i c c' = ("replace", i, c')-    cost _ = 1+    cost _ = Sum 1     positionOffset ("delete", _, _) = 0     positionOffset _ = 1
test/properties.hs view
@@ -13,7 +13,7 @@ import Test.QuickCheck import Test.QuickCheck.Instances () -import Data.Vector.Distance hiding (str)+import Data.Vector.Distance  -- | Changes to a 'String' (or other sequence, really). data C a@@ -46,10 +46,7 @@     delete = D     insert = I     substitute = S-    cost op = case op of-        D{} -> 1-        I{} -> 1-        S{} -> 1+    cost op = Sum 1     positionOffset op = case op of         D{} -> 0         _   -> 1@@ -58,7 +55,7 @@ prop_distance_id :: String -> Bool prop_distance_id s =     let s' = V.fromList s-    in leastChanges str s' s' == (0, [])+    in leastChanges str s' s' == (Sum 0, [])  -- | Delete everything! prop_distance_delete :: NonEmptyList Char -> Bool@@ -77,10 +74,10 @@         kitten = V.fromList ("kitten" :: String)         saturday = V.fromList ("Saturday" :: String)         sunday = V.fromList ("Sunday" :: String)-    in leastChanges str sitting kitten == (3, [S 0 's' 'k',S 4 'i' 'e',D 6 'g'])-    && leastChanges str kitten sitting == (3, [S 0 'k' 's',S 4 'e' 'i',I 6 'g'])-    && leastChanges str saturday sunday == (3, [D 1 'a',D 1 't',S 2 'r' 'n'])-    && leastChanges str sunday saturday == (3, [I 1 'a',I 2 't',S 4 'n' 'r'])+    in leastChanges str sitting kitten == (Sum 3, [S 0 's' 'k',S 4 'i' 'e',D 6 'g'])+    && leastChanges str kitten sitting == (Sum 3, [S 0 'k' 's',S 4 'e' 'i',I 6 'g'])+    && leastChanges str saturday sunday == (Sum 3, [D 1 'a',D 1 't',S 2 'r' 'n'])+    && leastChanges str sunday saturday == (Sum 3, [I 1 'a',I 2 't',S 4 'n' 'r'])  -- | Apply the found changes works. --