[Python-modules-commits] [fuzzywuzzy] 01/03: New upstream version 0.15.0

Edward Betts edward at moszumanska.debian.org
Mon Apr 17 16:27:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

edward pushed a commit to branch master
in repository fuzzywuzzy.

commit 92620ecca53ffdda93c6895acb58c20338f47855
Author: Edward Betts <edward at 4angle.com>
Date:   Mon Apr 17 17:20:22 2017 +0100

    New upstream version 0.15.0
---
 CHANGES.rst                      | 23 +++++++++++++++++
 PKG-INFO                         | 18 ++++++++++----
 README                           | 16 +++++++++---
 README.rst                       | 16 +++++++++---
 fuzzywuzzy.egg-info/PKG-INFO     | 18 ++++++++++----
 fuzzywuzzy.egg-info/SOURCES.txt  |  1 +
 fuzzywuzzy.egg-info/requires.txt |  3 +++
 fuzzywuzzy/__init__.py           |  2 +-
 fuzzywuzzy/fuzz.py               | 53 ++++++++++++++++++++++++++++++++++++++--
 fuzzywuzzy/utils.py              |  6 +++++
 setup.cfg                        |  1 -
 setup.py                         |  1 +
 12 files changed, 136 insertions(+), 22 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index 315c6c4..8b235fd 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,29 @@
 Changelog
 =========
 
+0.15.0 (2017-02-20)
+-------------------
+
+- Add extras require to install python-levenshtein optionally. [Rolando
+  Espinoza]
+
+  This allows to install python-levenshtein as dependency.
+
+
+- Fix link formatting in the README. [Alex Chan]
+
+- Add fuzzball.js JavaScript port link. [nolan]
+
+- Added Rust Port link. [Logan Collins]
+
+- Validate_string docstring. [davidcellis]
+
+- For full comparisons test that ONLY exact matches (after processing)
+  are added. [davidcellis]
+
+- Add detailed docstrings to WRatio and QRatio comparisons.
+  [davidcellis]
+
 0.14.0 (2016-11-04)
 -------------------
 
diff --git a/PKG-INFO b/PKG-INFO
index 991c1ac..8527bd7 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: fuzzywuzzy
-Version: 0.14.0
+Version: 0.15.0
 Summary: Fuzzy string matching in python
 Home-page: https://github.com/seatgeek/fuzzywuzzy
 Author: Adam Cohen
@@ -359,7 +359,7 @@ Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=mas
         -  Python 2.4 or higher
         -  difflib
         -  `python-Levenshtein <https://github.com/ztane/python-Levenshtein/>`_ (optional, provides a 4-10x speedup in String
-           Matching, though may result in [differing results for certain cases](https://github.com/seatgeek/fuzzywuzzy/issues/128))
+           Matching, though may result in `differing results for certain cases <https://github.com/seatgeek/fuzzywuzzy/issues/128>`_)
         
         Installation
         ============
@@ -370,17 +370,24 @@ Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=mas
         
             pip install fuzzywuzzy
         
+        or the following to install `python-Levenshtein` too
+        
+        .. code:: bash
+        
+            pip install fuzzywuzzy[speedup]
+        
+        
         Using PIP via Github
         
         .. code:: bash
         
-            pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+            pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
         
         Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
         
         .. code:: bash
         
-            git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+            git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
             
         Manually via GIT
         
@@ -465,7 +472,8 @@ Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=mas
         
         -  Java: `xpresso's fuzzywuzzy implementation <https://github.com/WantedTechnologies/xpresso/wiki/Approximate-string-comparison-and-pattern-matching-in-Java>`_
         -  Java: `fuzzywuzzy (java port) <https://github.com/xdrop/fuzzywuzzy>`_
-        
+        -  Rust: `fuzzyrusty (Rust port) <https://github.com/logannc/fuzzyrusty>`_
+        -  JavaScript: `fuzzball.js (JavaScript port) <https://github.com/nol13/fuzzball.js>`_
         
 Platform: UNKNOWN
 Classifier: Intended Audience :: Developers
diff --git a/README b/README
index 1308518..7d05484 100644
--- a/README
+++ b/README
@@ -12,7 +12,7 @@ Requirements
 -  Python 2.4 or higher
 -  difflib
 -  `python-Levenshtein <https://github.com/ztane/python-Levenshtein/>`_ (optional, provides a 4-10x speedup in String
-   Matching, though may result in [differing results for certain cases](https://github.com/seatgeek/fuzzywuzzy/issues/128))
+   Matching, though may result in `differing results for certain cases <https://github.com/seatgeek/fuzzywuzzy/issues/128>`_)
 
 Installation
 ============
@@ -23,17 +23,24 @@ Using PIP via PyPI
 
     pip install fuzzywuzzy
 
+or the following to install `python-Levenshtein` too
+
+.. code:: bash
+
+    pip install fuzzywuzzy[speedup]
+
+
 Using PIP via Github
 
 .. code:: bash
 
-    pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+    pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
 
 Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
 
 .. code:: bash
 
-    git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+    git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
     
 Manually via GIT
 
@@ -118,4 +125,5 @@ FuzzyWuzzy is being ported to other languages too! Here are a few ports we know
 
 -  Java: `xpresso's fuzzywuzzy implementation <https://github.com/WantedTechnologies/xpresso/wiki/Approximate-string-comparison-and-pattern-matching-in-Java>`_
 -  Java: `fuzzywuzzy (java port) <https://github.com/xdrop/fuzzywuzzy>`_
-
+-  Rust: `fuzzyrusty (Rust port) <https://github.com/logannc/fuzzyrusty>`_
+-  JavaScript: `fuzzball.js (JavaScript port) <https://github.com/nol13/fuzzball.js>`_
diff --git a/README.rst b/README.rst
index 1308518..7d05484 100644
--- a/README.rst
+++ b/README.rst
@@ -12,7 +12,7 @@ Requirements
 -  Python 2.4 or higher
 -  difflib
 -  `python-Levenshtein <https://github.com/ztane/python-Levenshtein/>`_ (optional, provides a 4-10x speedup in String
-   Matching, though may result in [differing results for certain cases](https://github.com/seatgeek/fuzzywuzzy/issues/128))
+   Matching, though may result in `differing results for certain cases <https://github.com/seatgeek/fuzzywuzzy/issues/128>`_)
 
 Installation
 ============
@@ -23,17 +23,24 @@ Using PIP via PyPI
 
     pip install fuzzywuzzy
 
+or the following to install `python-Levenshtein` too
+
+.. code:: bash
+
+    pip install fuzzywuzzy[speedup]
+
+
 Using PIP via Github
 
 .. code:: bash
 
-    pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+    pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
 
 Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
 
 .. code:: bash
 
-    git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+    git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
     
 Manually via GIT
 
@@ -118,4 +125,5 @@ FuzzyWuzzy is being ported to other languages too! Here are a few ports we know
 
 -  Java: `xpresso's fuzzywuzzy implementation <https://github.com/WantedTechnologies/xpresso/wiki/Approximate-string-comparison-and-pattern-matching-in-Java>`_
 -  Java: `fuzzywuzzy (java port) <https://github.com/xdrop/fuzzywuzzy>`_
-
+-  Rust: `fuzzyrusty (Rust port) <https://github.com/logannc/fuzzyrusty>`_
+-  JavaScript: `fuzzball.js (JavaScript port) <https://github.com/nol13/fuzzball.js>`_
diff --git a/fuzzywuzzy.egg-info/PKG-INFO b/fuzzywuzzy.egg-info/PKG-INFO
index 991c1ac..8527bd7 100644
--- a/fuzzywuzzy.egg-info/PKG-INFO
+++ b/fuzzywuzzy.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: fuzzywuzzy
-Version: 0.14.0
+Version: 0.15.0
 Summary: Fuzzy string matching in python
 Home-page: https://github.com/seatgeek/fuzzywuzzy
 Author: Adam Cohen
@@ -359,7 +359,7 @@ Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=mas
         -  Python 2.4 or higher
         -  difflib
         -  `python-Levenshtein <https://github.com/ztane/python-Levenshtein/>`_ (optional, provides a 4-10x speedup in String
-           Matching, though may result in [differing results for certain cases](https://github.com/seatgeek/fuzzywuzzy/issues/128))
+           Matching, though may result in `differing results for certain cases <https://github.com/seatgeek/fuzzywuzzy/issues/128>`_)
         
         Installation
         ============
@@ -370,17 +370,24 @@ Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=mas
         
             pip install fuzzywuzzy
         
+        or the following to install `python-Levenshtein` too
+        
+        .. code:: bash
+        
+            pip install fuzzywuzzy[speedup]
+        
+        
         Using PIP via Github
         
         .. code:: bash
         
-            pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+            pip install git+git://github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
         
         Adding to your ``requirements.txt`` file (run ``pip install -r requirements.txt`` afterwards)
         
         .. code:: bash
         
-            git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.14.0#egg=fuzzywuzzy
+            git+ssh://git@github.com/seatgeek/fuzzywuzzy.git@0.15.0#egg=fuzzywuzzy
             
         Manually via GIT
         
@@ -465,7 +472,8 @@ Description: .. image:: https://travis-ci.org/seatgeek/fuzzywuzzy.svg?branch=mas
         
         -  Java: `xpresso's fuzzywuzzy implementation <https://github.com/WantedTechnologies/xpresso/wiki/Approximate-string-comparison-and-pattern-matching-in-Java>`_
         -  Java: `fuzzywuzzy (java port) <https://github.com/xdrop/fuzzywuzzy>`_
-        
+        -  Rust: `fuzzyrusty (Rust port) <https://github.com/logannc/fuzzyrusty>`_
+        -  JavaScript: `fuzzball.js (JavaScript port) <https://github.com/nol13/fuzzball.js>`_
         
 Platform: UNKNOWN
 Classifier: Intended Audience :: Developers
diff --git a/fuzzywuzzy.egg-info/SOURCES.txt b/fuzzywuzzy.egg-info/SOURCES.txt
index af76041..c7a13e0 100644
--- a/fuzzywuzzy.egg-info/SOURCES.txt
+++ b/fuzzywuzzy.egg-info/SOURCES.txt
@@ -17,5 +17,6 @@ fuzzywuzzy.egg-info/PKG-INFO
 fuzzywuzzy.egg-info/SOURCES.txt
 fuzzywuzzy.egg-info/dependency_links.txt
 fuzzywuzzy.egg-info/pbr.json
+fuzzywuzzy.egg-info/requires.txt
 fuzzywuzzy.egg-info/top_level.txt
 fuzzywuzzy.egg-info/zip-safe
\ No newline at end of file
diff --git a/fuzzywuzzy.egg-info/requires.txt b/fuzzywuzzy.egg-info/requires.txt
new file mode 100644
index 0000000..4f5af9d
--- /dev/null
+++ b/fuzzywuzzy.egg-info/requires.txt
@@ -0,0 +1,3 @@
+
+[speedup]
+python-levenshtein>=0.12
diff --git a/fuzzywuzzy/__init__.py b/fuzzywuzzy/__init__.py
index c25929f..00d71b2 100644
--- a/fuzzywuzzy/__init__.py
+++ b/fuzzywuzzy/__init__.py
@@ -1,2 +1,2 @@
 # -*- coding: utf-8 -*-
-__version__ = '0.14.0'
+__version__ = '0.15.0'
diff --git a/fuzzywuzzy/fuzz.py b/fuzzywuzzy/fuzz.py
index 843c72b..f12bb0f 100644
--- a/fuzzywuzzy/fuzz.py
+++ b/fuzzywuzzy/fuzz.py
@@ -198,6 +198,17 @@ def partial_token_set_ratio(s1, s2, force_ascii=True, full_process=True):
 
 # q is for quick
 def QRatio(s1, s2, force_ascii=True):
+    """
+    Quick ratio comparison between two strings.
+
+    Runs full_process from utils on both strings
+    Short circuits if either of the strings is empty after processing.
+
+    :param s1:
+    :param s2:
+    :param force_ascii: Allow only ASCII characters (Default: True)
+    :return: similarity ratio
+    """
 
     p1 = utils.full_process(s1, force_ascii=force_ascii)
     p2 = utils.full_process(s2, force_ascii=force_ascii)
@@ -211,13 +222,51 @@ def QRatio(s1, s2, force_ascii=True):
 
 
 def UQRatio(s1, s2):
+    """
+    Unicode quick ratio
+
+    Calls QRatio with force_ascii set to False
+
+    :param s1:
+    :param s2:
+    :return: similarity ratio
+    """
     return QRatio(s1, s2, force_ascii=False)
 
 
 # w is for weighted
 def WRatio(s1, s2, force_ascii=True):
-    """Return a measure of the sequences' similarity between 0 and 100,
-    using different algorithms.
+    """
+    Return a measure of the sequences' similarity between 0 and 100, using different algorithms.
+
+    **Steps in the order they occur**
+
+    #. Run full_process from utils on both strings
+    #. Short circuit if this makes either string empty
+    #. Take the ratio of the two processed strings (fuzz.ratio)
+    #. Run checks to compare the length of the strings
+        * If one of the strings is more than 1.5 times as long as the other
+          use partial_ratio comparisons - scale partial results by 0.9
+          (this makes sure only full results can return 100)
+        * If one of the strings is over 8 times as long as the other
+          instead scale by 0.6
+
+    #. Run the other ratio functions
+        * if using partial ratio functions call partial_ratio,
+          partial_token_sort_ratio and partial_token_set_ratio
+          scale all of these by the ratio based on length
+        * otherwise call token_sort_ratio and token_set_ratio
+        * all token based comparisons are scaled by 0.95
+          (on top of any partial scalars)
+
+    #. Take the highest value from these results
+       round it and return it as an integer.
+
+    :param s1:
+    :param s2:
+    :param force_ascii: Allow only ascii characters
+    :type force_ascii: bool
+    :return:
     """
 
     p1 = utils.full_process(s1, force_ascii=force_ascii)
diff --git a/fuzzywuzzy/utils.py b/fuzzywuzzy/utils.py
index ec62838..db9d287 100644
--- a/fuzzywuzzy/utils.py
+++ b/fuzzywuzzy/utils.py
@@ -9,6 +9,12 @@ PY3 = sys.version_info[0] == 3
 
 
 def validate_string(s):
+    """
+    Check input has length and that length > 0
+
+    :param s:
+    :return: True if len(s) > 0 else False
+    """
     try:
         return len(s) > 0
     except TypeError:
diff --git a/setup.cfg b/setup.cfg
index 6f08d0e..adf5ed7 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -4,5 +4,4 @@ universal = 1
 [egg_info]
 tag_build = 
 tag_date = 0
-tag_svn_revision = 0
 
diff --git a/setup.py b/setup.py
index 0e77e27..d977b14 100644
--- a/setup.py
+++ b/setup.py
@@ -23,6 +23,7 @@ setup(
     author='Adam Cohen',
     author_email='adam at seatgeek.com',
     packages=['fuzzywuzzy'],
+    extras_require={'speedup': ['python-levenshtein>=0.12']},
     url='https://github.com/seatgeek/fuzzywuzzy',
     license=open('LICENSE.txt').read(),
     classifiers=[

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/fuzzywuzzy.git



More information about the Python-modules-commits mailing list