annotate textshaper/textshaper.py @ 5:0a800613af9a

textshaper/main.py
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 26 Sep 2013 02:02:36 -0700
parents e5adf3414c6b
children 6e382347af17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/usr/bin/env python
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3 """
2
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
4 textshaper : text manipulation
1
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 So you have a block of text ...
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 What do you want to do with it?!?
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 == Desired Functionality ==
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
2
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
11 - onelineit
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
12 - quoting
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
13 - dequoting (including e.g. +/-, diff-ish shit)
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
14 - remove whitespace
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
15 - removing timestamps
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
16 - removing/adding irc quote tags
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
17
1
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 == Previous work ==
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20 /corpus of past programs -> consolidate/
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 Interface:
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 - library code
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 - (n)curses
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 - javascript/REST
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 Consider the pattern:
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
30 * things that add and/or remove a thing
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
31 * things that alter spacing
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
33
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
34 == Reference ==
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
35
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
36 Previous k0s.ware (big and small):
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
37 - http://k0s.org/hg/config/rev/5e0b4ec36013
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
38
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
39 Highly related (~> identity): http://k0s.org/portfolio/ideas/cleanuptext.py
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
40
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
41 Ubuntu packages:
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
42 - par (paragraph reformatter)
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
43 """
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
44
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
45
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
46
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
47
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
48
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
49
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
50
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
51
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
52
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
53
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
54
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
55
92baf2c5652f -> http://k0s.org/portfolio/ideas/textshaper.py
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
56
2
e5adf3414c6b -> http://k0s.org/portfolio/ideas/cleanuptext.py
Jeff Hammel <jhammel@mozilla.com>
parents: 1
diff changeset
57