From 24a18140ed3b001aa8700ef8b9e409e7613db865 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Tue, 10 Oct 2017 17:27:05 +0200 Subject: [PATCH] Added whitespace/newline in textcontent behaviour check and bumped version (proycon/folia#34) --- pynlpl/__init__.py | 2 +- pynlpl/tests/folia.py | 22 ++++++++++++++++++++-- setup.py | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/pynlpl/__init__.py b/pynlpl/__init__.py index 119bd64c..e8b6763a 100644 --- a/pynlpl/__init__.py +++ b/pynlpl/__init__.py @@ -2,4 +2,4 @@ The library is divided into several packages and modules. It is designed for Python 2.6 and upwards. Including Python 3.""" -VERSION = "1.2" +VERSION = "1.2.1" diff --git a/pynlpl/tests/folia.py b/pynlpl/tests/folia.py index 80f252ea..4f97e156 100755 --- a/pynlpl/tests/folia.py +++ b/pynlpl/tests/folia.py @@ -37,7 +37,7 @@ stderr = sys.stderr stdout = sys.stdout -FOLIARELEASE = "v1.5.0.57" +FOLIARELEASE = "v1.5.0.58" #FOLIARELEASE = None #development version, do *NOT* release if this is set! if os.path.exists('../../../FoLiA'): @@ -3681,7 +3681,7 @@ def test013g_correction(self): self.assertTrue(raised) def test014_fullparagraph(self): - """Validation - Text Validation on a full paragraph""" + """Validation - Text Validation with sentence text delimiter inheritance""" xml = """ @@ -3894,6 +3894,24 @@ def test014_fullparagraph(self): doc = folia.Document(string=xml, textvalidation=True) + def test015_textwhitespace(self): + """Validation - Text Validation with sentence text delimiter inheritance""" + xml = """ + + + + + + + Dit + is een rare test. + + + +""".format(version=folia.FOLIAVERSION, generator='pynlpl.formats.folia-v' + folia.LIBVERSION) + doc = folia.Document(string=xml, textvalidation=True) + self.assertEqual( doc['test.s'].text(), "Dit\n is een rare test.\n ") + with io.open(FOLIAPATH + '/test/example.xml', 'r',encoding='utf-8') as foliaexample_f: FOLIAEXAMPLE = foliaexample_f.read() diff --git a/setup.py b/setup.py index 88f2af64..be12b28d 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def read(fname): setup( name = "PyNLPl", - version = "1.2", #edit version in __init__.py as well and ensure tests/folia.py FOLIARELEASE points to the right version and is not set to None! + version = "1.2.1", #edit version in __init__.py as well and ensure tests/folia.py FOLIARELEASE points to the right version and is not set to None! author = "Maarten van Gompel", author_email = "proycon@anaproy.nl", description = ("PyNLPl, pronounced as 'pineapple', is a Python library for Natural Language Processing. It contains various modules useful for common, and less common, NLP tasks. PyNLPl contains modules for basic tasks, clients for interfacting with server, and modules for parsing several file formats common in NLP, most notably FoLiA."),