Hello community,

here is the log from the commit of package python-padaos for openSUSE:Factory 
checked in at 2019-04-30 13:04:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-padaos (Old)
 and      /work/SRC/openSUSE:Factory/.python-padaos.new.5536 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-padaos"

Tue Apr 30 13:04:58 2019 rev:6 rq:698091 version:0.1.10

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-padaos/python-padaos.changes      
2019-02-04 14:24:59.977065487 +0100
+++ /work/SRC/openSUSE:Factory/.python-padaos.new.5536/python-padaos.changes    
2019-04-30 13:05:07.961949096 +0200
@@ -1,0 +2,10 @@
+Fri Apr 26 06:09:11 UTC 2019 - pgaj...@suse.com
+
+- version update to 0.1.10
+  * Fix space issue
+- added sources
+  https://github.com/MycroftAI/padaos/issues/7
+  + LICENSE
+  + test_padaos.py
+
+-------------------------------------------------------------------

Old:
----
  padaos-0.1.9.tar.gz

New:
----
  LICENSE
  padaos-0.1.10.tar.gz
  test_padaos.py

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-padaos.spec ++++++
--- /var/tmp/diff_new_pack.RPGLoh/_old  2019-04-30 13:05:09.129948040 +0200
+++ /var/tmp/diff_new_pack.RPGLoh/_new  2019-04-30 13:05:09.133948036 +0200
@@ -20,13 +20,17 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           python-padaos
-Version:        0.1.9
+Version:        0.1.10
 Release:        0
 Summary:        An intent parser
 License:        MIT
 Group:          Development/Languages/Python
 Url:            http://github.com/MatthewScholefield/padaos
-Source:         
https://files.pythonhosted.org/packages/source/p/padaos/padaos-%{version}.tar.gz
+Source0:        
https://files.pythonhosted.org/packages/source/p/padaos/padaos-%{version}.tar.gz
+# https://github.com/MycroftAI/padaos/issues/7
+Source1:        
https://raw.githubusercontent.com/MycroftAI/padaos/master/LICENSE
+Source2:        
https://raw.githubusercontent.com/MycroftAI/padaos/master/test_padaos.py
+BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
 BuildRequires:  python-rpm-macros
@@ -42,6 +46,7 @@
 
 %prep
 %setup -q -n padaos-%{version}
+cp %{SOURCE1} %{SOURCE2} .
 
 %build
 %python_build
@@ -50,7 +55,11 @@
 %python_install
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
 
+%check
+%pytest
+
 %files %{python_files}
+%license LICENSE
 %doc README.md
 %{python_sitelib}/padaos.*
 %{python_sitelib}/__pycache__/padaos.*

++++++ LICENSE ++++++
Copyright 2018 Matthew D. Scholefield

Permission is hereby granted, free of charge, to any person obtaining a copy of 
this software and associated documentation files (the "Software"), to deal in 
the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.++++++ padaos-0.1.9.tar.gz -> padaos-0.1.10.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padaos-0.1.9/PKG-INFO new/padaos-0.1.10/PKG-INFO
--- old/padaos-0.1.9/PKG-INFO   2019-01-30 17:44:25.000000000 +0100
+++ new/padaos-0.1.10/PKG-INFO  2019-04-19 17:34:26.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: padaos
-Version: 0.1.9
+Version: 0.1.10
 Summary: A rigid, lightweight, dead-simple intent parser
 Home-page: http://github.com/MatthewScholefield/padaos
 Author: Matthew Scholefield
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padaos-0.1.9/padaos.egg-info/PKG-INFO 
new/padaos-0.1.10/padaos.egg-info/PKG-INFO
--- old/padaos-0.1.9/padaos.egg-info/PKG-INFO   2019-01-30 17:44:25.000000000 
+0100
+++ new/padaos-0.1.10/padaos.egg-info/PKG-INFO  2019-04-19 17:34:26.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: padaos
-Version: 0.1.9
+Version: 0.1.10
 Summary: A rigid, lightweight, dead-simple intent parser
 Home-page: http://github.com/MatthewScholefield/padaos
 Author: Matthew Scholefield
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padaos-0.1.9/padaos.py new/padaos-0.1.10/padaos.py
--- old/padaos-0.1.9/padaos.py  2019-01-30 17:43:54.000000000 +0100
+++ new/padaos-0.1.10/padaos.py 2019-04-19 17:21:19.000000000 +0200
@@ -71,7 +71,7 @@
                 (r'(\\[^\w ])', r'\1?'),
 
                 # === Force 1+ Space Between Words ===
-                (r'(?<=\w)(\\\s|\s)+', r'\\W+'),
+                (r'(?<=(\w|\}))(\\\s|\s)+(?=\S)', r'\\W+'),
 
                 # === Force 0+ Space Between Everything Else ===
                 (r'\s+', r'\\W*'),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/padaos-0.1.9/setup.py new/padaos-0.1.10/setup.py
--- old/padaos-0.1.9/setup.py   2019-01-30 17:43:54.000000000 +0100
+++ new/padaos-0.1.10/setup.py  2019-04-19 17:21:19.000000000 +0200
@@ -4,7 +4,7 @@
 
 setup(
     name='padaos',
-    version='0.1.9',
+    version='0.1.10',
     description='A rigid, lightweight, dead-simple intent parser',
     url='http://github.com/MatthewScholefield/padaos',
     author='Matthew Scholefield',

++++++ test_padaos.py ++++++
from padaos import IntentContainer


class TestIntentContainer:
    def setup(self):
        self.container = IntentContainer()

    def test(self):
        self.container.add_intent('hello', [
            'hello', 'hi', 'how are you', "what's up"
        ])
        self.container.add_intent('buy', [
            'buy {item}', 'purchase {item}', 'get {item}', 'get {item} for me'
        ])
        self.container.add_entity('item', [
            'milk', 'cheese'
        ])
        self.container.add_intent('drive', [
            'drive me to {place}', 'take me to {place}', 'navigate to {place}'
        ])
        self.container.add_intent('eat', [
            'eat {fruit}', 'eat some {fruit}', 'munch on (some|) {fruit}'
        ])
        self.container.compile()
        assert self.container.calc_intent('hello')['name'] == 'hello'
        assert not self.container.calc_intent('bye')['name']
        assert self.container.calc_intent('buy milk') == {
            'name': 'buy', 'entities': {'item': 'milk'}
        }
        assert self.container.calc_intent('eat some bananas') == {
            'name': 'eat', 'entities': {'fruit': 'bananas'}
        }

    def test_case(self):
        self.container.add_intent('test', ['Testing cAPitalizAtion'])
        assert self.container.calc_intent('teStiNg CapitalIzation')['name'] == 
'test'

    def test_punctuation(self):
        self.container.add_intent('test', ['Test! Of: Punctuation'])
        assert self.container.calc_intent('test of !punctuation...')['name'] == 
'test'

    def test_spaces(self):
        self.container.add_intent('test', ['this is a test'])
        assert self.container.calc_intent('thisisatest')['name'] is None
        self.container.add_intent('test2', ['this has(one|two)options'])
        assert self.container.calc_intent('this has two options')['name'] == 
'test2'
        assert self.container.calc_intent('th is is a test')['name'] is None

        self.container.add_intent('test3', ['I see {thing} (in|on) {place}'])
        assert self.container.calc_intent('I see a bin test')['name'] is None
        assert self.container.calc_intent('I see a bin in there') == {
            'name': 'test3', 'entities': {'thing': 'a bin', 'place': 'there'}
        }

Reply via email to