Mercurial > hg > TextShaper
comparison textshaper/split.py @ 48:03ce88daa98d
start test
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Sat, 16 May 2015 19:07:38 -0700 |
parents | 7e63ca061b6c |
children | 1284c99a94fa |
comparison
equal
deleted
inserted
replaced
47:6c7ca72777af | 48:03ce88daa98d |
---|---|
43 options = parser.parse_args(args) | 43 options = parser.parse_args(args) |
44 | 44 |
45 # preprocess text | 45 # preprocess text |
46 text = options.file.read().strip() | 46 text = options.file.read().strip() |
47 text = ' '.join(text.split()) | 47 text = ' '.join(text.split()) |
48 # paragraphs = split_paragraphs(text) | 48 # paragraphs = split_paragraphs(text) |
49 | 49 |
50 ends = '.?!' | 50 ends = '.?!' |
51 | 51 |
52 for end in ends: | 52 # find all ending punctuation |
53 # for paragraph in paragraphs: | 53 indices = {end: findall(text, end) for end in ends} |
54 # print (paragraph) | 54 |
55 | 55 |
56 if __name__ == '__main__': | 56 if __name__ == '__main__': |
57 main() | 57 main() |