Skip to content

Commit

Permalink
Added whitespace/newline in textcontent behaviour check and bumped ve…
Browse files Browse the repository at this point in the history
…rsion (proycon/folia#34)
  • Loading branch information
proycon committed Oct 10, 2017
1 parent 817858d commit 24a1814
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pynlpl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
22 changes: 20 additions & 2 deletions pynlpl/tests/folia.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down Expand Up @@ -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 = """<?xml version="1.0" encoding="UTF-8"?>
<FoLiA xmlns="http://ilk.uvt.nl/folia" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="test" version="{version}" generator="{generator}">
<metadata type="native">
Expand Down Expand Up @@ -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 = """<?xml version="1.0" encoding="UTF-8"?>
<FoLiA xmlns="http://ilk.uvt.nl/folia" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="test" version="{version}" generator="{generator}">
<metadata type="native">
<annotations>
</annotations>
</metadata>
<text xml:id="test">
<s xml:id="test.s"><t>Dit
is een rare test.
</t>
</s>
</text>
</FoLiA>""".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()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."),
Expand Down

0 comments on commit 24a1814

Please sign in to comment.