Mercurial > hg > TextShaper
changeset 48:03ce88daa98d
start test
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sat, 16 May 2015 19:07:38 -0700 |
parents | 6c7ca72777af |
children | 643c8e92e71e |
files | tests/test_split.py textshaper/split.py |
diffstat | 2 files changed, 26 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test_split.py Sat May 16 19:07:38 2015 -0700 @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +unit tests for `textshaper.split` +""" + +# imports +import unittest +from textshaper import split + + +class SplitUnitTest(unittest.TestCase): + + def test_findall(self): + """test basic""" + + +if __name__ == '__main__': + unittest.main() +
--- a/textshaper/split.py Sat May 16 19:02:03 2015 -0700 +++ b/textshaper/split.py Sat May 16 19:07:38 2015 -0700 @@ -45,13 +45,13 @@ # preprocess text text = options.file.read().strip() text = ' '.join(text.split()) -# paragraphs = split_paragraphs(text) + # paragraphs = split_paragraphs(text) - ends = '.?!' + ends = '.?!' - for end in ends: -# for paragraph in paragraphs: -# print (paragraph) + # find all ending punctuation + indices = {end: findall(text, end) for end in ends} + if __name__ == '__main__': main()