Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package ghc-text-metrics for
openSUSE:Factory checked in at 2022-02-11 23:09:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-text-metrics (Old)
and /work/SRC/openSUSE:Factory/.ghc-text-metrics.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-text-metrics"
Fri Feb 11 23:09:46 2022 rev:12 rq:953542 version:0.3.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/ghc-text-metrics/ghc-text-metrics.changes
2021-09-10 23:41:08.082548112 +0200
+++
/work/SRC/openSUSE:Factory/.ghc-text-metrics.new.1956/ghc-text-metrics.changes
2022-02-11 23:11:44.343350233 +0100
@@ -1,0 +2,8 @@
+Thu Dec 30 10:10:02 UTC 2021 - Peter Simons <[email protected]>
+
+- Update text-metrics to version 0.3.2.
+ ## Text Metrics 0.3.2
+
+ * Works with `text-2.0`.
+
+-------------------------------------------------------------------
Old:
----
text-metrics-0.3.1.tar.gz
New:
----
text-metrics-0.3.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-text-metrics.spec ++++++
--- /var/tmp/diff_new_pack.aS6VPK/_old 2022-02-11 23:11:44.783351505 +0100
+++ /var/tmp/diff_new_pack.aS6VPK/_new 2022-02-11 23:11:44.787351517 +0100
@@ -19,7 +19,7 @@
%global pkg_name text-metrics
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.3.1
+Version: 0.3.2
Release: 0
Summary: Calculate various string metrics efficiently
License: BSD-3-Clause
++++++ text-metrics-0.3.1.tar.gz -> text-metrics-0.3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/text-metrics-0.3.1/CHANGELOG.md
new/text-metrics-0.3.2/CHANGELOG.md
--- old/text-metrics-0.3.1/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200
+++ new/text-metrics-0.3.2/CHANGELOG.md 2001-09-09 03:46:40.000000000 +0200
@@ -1,3 +1,7 @@
+## Text Metrics 0.3.2
+
+* Works with `text-2.0`.
+
## Text Metrics 0.3.1
* Fixed a bug in the implementation of Jaro-Winkler distance when two
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/text-metrics-0.3.1/Data/Text/Metrics.hs
new/text-metrics-0.3.2/Data/Text/Metrics.hs
--- old/text-metrics-0.3.1/Data/Text/Metrics.hs 2001-09-09 03:46:40.000000000
+0200
+++ new/text-metrics-0.3.2/Data/Text/Metrics.hs 2001-09-09 03:46:40.000000000
+0200
@@ -43,6 +43,7 @@
import Data.Ratio
import Data.Text
import qualified Data.Text as T
+import qualified Data.Text.Internal as T
import qualified Data.Text.Unsafe as TU
import qualified Data.Vector.Unboxed.Mutable as VUM
import GHC.Exts (inline)
@@ -83,31 +84,31 @@
| T.null a = (lenb, lenm)
| T.null b = (lena, lenm)
| otherwise = runST $ do
- let v_len = lenb + 1
- v <- VUM.unsafeNew (v_len * 2)
- let gov !i =
- when (i < v_len) $ do
- VUM.unsafeWrite v i i
- gov (i + 1)
- goi !i !na !v0 !v1 = do
- let !(TU.Iter ai da) = TU.iter a na
- goj !j !nb =
- when (j < lenb) $ do
- let !(TU.Iter bj db) = TU.iter b nb
- cost = if ai == bj then 0 else 1
- x <- (+ 1) <$> VUM.unsafeRead v (v1 + j)
- y <- (+ 1) <$> VUM.unsafeRead v (v0 + j + 1)
- z <- (+ cost) <$> VUM.unsafeRead v (v0 + j)
- VUM.unsafeWrite v (v1 + j + 1) (min x (min y z))
- goj (j + 1) (nb + db)
- when (i < lena) $ do
- VUM.unsafeWrite v v1 (i + 1)
- goj 0 0
- goi (i + 1) (na + da) v1 v0
- gov 0
- goi 0 0 0 v_len
- ld <- VUM.unsafeRead v (lenb + if even lena then 0 else v_len)
- return (ld, lenm)
+ let v_len = lenb + 1
+ v <- VUM.unsafeNew (v_len * 2)
+ let gov !i =
+ when (i < v_len) $ do
+ VUM.unsafeWrite v i i
+ gov (i + 1)
+ goi !i !na !v0 !v1 = do
+ let !(TU.Iter ai da) = TU.iter a na
+ goj !j !nb =
+ when (j < lenb) $ do
+ let !(TU.Iter bj db) = TU.iter b nb
+ cost = if ai == bj then 0 else 1
+ x <- (+ 1) <$> VUM.unsafeRead v (v1 + j)
+ y <- (+ 1) <$> VUM.unsafeRead v (v0 + j + 1)
+ z <- (+ cost) <$> VUM.unsafeRead v (v0 + j)
+ VUM.unsafeWrite v (v1 + j + 1) (min x (min y z))
+ goj (j + 1) (nb + db)
+ when (i < lena) $ do
+ VUM.unsafeWrite v v1 (i + 1)
+ goj 0 0
+ goi (i + 1) (na + da) v1 v0
+ gov 0
+ goi 0 0 0 v_len
+ ld <- VUM.unsafeRead v (lenb + if even lena then 0 else v_len)
+ return (ld, lenm)
where
lena = T.length a
lenb = T.length b
@@ -144,36 +145,36 @@
| T.null a = (lenb, lenm)
| T.null b = (lena, lenm)
| otherwise = runST $ do
- let v_len = lenb + 1
- v <- VUM.unsafeNew (v_len * 3)
- let gov !i =
- when (i < v_len) $ do
- VUM.unsafeWrite v i i
- gov (i + 1)
- goi !i !na !ai_1 !v0 !v1 !v2 = do
- let !(TU.Iter ai da) = TU.iter a na
- goj !j !nb !bj_1 =
- when (j < lenb) $ do
- let !(TU.Iter bj db) = TU.iter b nb
- cost = if ai == bj then 0 else 1
- x <- (+ 1) <$> VUM.unsafeRead v (v1 + j)
- y <- (+ 1) <$> VUM.unsafeRead v (v0 + j + 1)
- z <- (+ cost) <$> VUM.unsafeRead v (v0 + j)
- let g = min x (min y z)
- val <- (+ cost) <$> VUM.unsafeRead v (v2 + j - 1)
- VUM.unsafeWrite v (v1 + j + 1) $
- if i > 0 && j > 0 && ai == bj_1 && ai_1 == bj && val < g
- then val
- else g
- goj (j + 1) (nb + db) bj
- when (i < lena) $ do
- VUM.unsafeWrite v v1 (i + 1)
- goj 0 0 'a'
- goi (i + 1) (na + da) ai v1 v2 v0
- gov 0
- goi 0 0 'a' 0 v_len (v_len * 2)
- ld <- VUM.unsafeRead v (lenb + (lena `mod` 3) * v_len)
- return (ld, lenm)
+ let v_len = lenb + 1
+ v <- VUM.unsafeNew (v_len * 3)
+ let gov !i =
+ when (i < v_len) $ do
+ VUM.unsafeWrite v i i
+ gov (i + 1)
+ goi !i !na !ai_1 !v0 !v1 !v2 = do
+ let !(TU.Iter ai da) = TU.iter a na
+ goj !j !nb !bj_1 =
+ when (j < lenb) $ do
+ let !(TU.Iter bj db) = TU.iter b nb
+ cost = if ai == bj then 0 else 1
+ x <- (+ 1) <$> VUM.unsafeRead v (v1 + j)
+ y <- (+ 1) <$> VUM.unsafeRead v (v0 + j + 1)
+ z <- (+ cost) <$> VUM.unsafeRead v (v0 + j)
+ let g = min x (min y z)
+ val <- (+ cost) <$> VUM.unsafeRead v (v2 + j - 1)
+ VUM.unsafeWrite v (v1 + j + 1) $
+ if i > 0 && j > 0 && ai == bj_1 && ai_1 == bj && val < g
+ then val
+ else g
+ goj (j + 1) (nb + db) bj
+ when (i < lena) $ do
+ VUM.unsafeWrite v v1 (i + 1)
+ goj 0 0 'a'
+ goi (i + 1) (na + da) ai v1 v2 v0
+ gov 0
+ goi 0 0 'a' 0 v_len (v_len * 2)
+ ld <- VUM.unsafeRead v (lenb + (lena `mod` 3) * v_len)
+ return (ld, lenm)
where
lena = T.length a
lenb = T.length b
@@ -246,7 +247,7 @@
-- __Heads up__, before version /0.3.0/ this function returned @'Maybe'
-- 'Data.Numeric.Natural'@.
hamming :: Text -> Text -> Maybe Int
-hamming a b =
+hamming a@(T.Text _ _ len) b =
if T.length a == T.length b
then Just (go 0 0 0)
else Nothing
@@ -258,7 +259,6 @@
| na == len -> r
| cha /= chb -> go (na + da) (nb + db) (r + 1)
| otherwise -> go (na + da) (nb + db) r
- len = TU.lengthWord16 a
-- | Return the Jaro distance between two 'Text' values. Returned value is
-- in the range from 0 (no similarity) to 1 (exact match).
@@ -348,18 +348,9 @@
-- | Return the length of the common prefix two 'Text' values have.
commonPrefix :: Text -> Text -> Int
-commonPrefix a b = go 0 0 0
- where
- go !na !nb !r =
- let !(TU.Iter cha da) = TU.iter a na
- !(TU.Iter chb db) = TU.iter b nb
- in if
- | na == lena -> r
- | nb == lenb -> r
- | cha == chb -> go (na + da) (nb + db) (r + 1)
- | otherwise -> r
- lena = TU.lengthWord16 a
- lenb = TU.lengthWord16 b
+commonPrefix a b = case T.commonPrefixes a b of
+ Nothing -> 0
+ Just (pref, _, _) -> T.length pref
{-# INLINE commonPrefix #-}
----------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/text-metrics-0.3.1/text-metrics.cabal
new/text-metrics-0.3.2/text-metrics.cabal
--- old/text-metrics-0.3.1/text-metrics.cabal 2001-09-09 03:46:40.000000000
+0200
+++ new/text-metrics-0.3.2/text-metrics.cabal 2001-09-09 03:46:40.000000000
+0200
@@ -1,11 +1,11 @@
-cabal-version: 1.18
+cabal-version: 2.4
name: text-metrics
-version: 0.3.1
-license: BSD3
+version: 0.3.2
+license: BSD-3-Clause
license-file: LICENSE.md
maintainer: Mark Karpov <[email protected]>
author: Mark Karpov <[email protected]>
-tested-with: ghc ==8.8.4 ghc ==8.10.5 ghc ==9.0.1
+tested-with: ghc ==8.10.7 ghc ==9.0.1 ghc ==9.2.1
homepage: https://github.com/mrkkrp/text-metrics
bug-reports: https://github.com/mrkkrp/text-metrics/issues
synopsis: Calculate various string metrics efficiently
@@ -31,7 +31,7 @@
build-depends:
base >=4.13 && <5.0,
containers >=0.5 && <0.7,
- text >=0.2 && <1.3,
+ text >=0.2 && <2.1,
vector >=0.11 && <0.13
if flag(dev)
@@ -49,7 +49,7 @@
QuickCheck >=2.8 && <3.0,
base >=4.13 && <5.0,
hspec >=2.0 && <3.0,
- text >=0.2 && <1.3,
+ text >=0.2 && <2.1,
text-metrics
if flag(dev)
@@ -72,7 +72,7 @@
base >=4.13 && <5.0,
criterion >=0.6.2.1 && <1.6,
deepseq >=1.3 && <1.5,
- text >=0.2 && <1.3,
+ text >=0.2 && <2.1,
text-metrics
if flag(dev)
@@ -89,7 +89,7 @@
build-depends:
base >=4.13 && <5.0,
deepseq >=1.3 && <1.5,
- text >=0.2 && <1.3,
+ text >=0.2 && <2.1,
text-metrics,
weigh >=0.0.4