# HG changeset patch # User Jeff Hammel # Date 1431828458 25200 # Node ID 03ce88daa98d4e264306e2e471556c19209af88f # Parent 6c7ca72777afa1c7991b46834f409486a5b97605 start test diff -r 6c7ca72777af -r 03ce88daa98d tests/test_split.py --- /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() + diff -r 6c7ca72777af -r 03ce88daa98d textshaper/split.py --- 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()