Skip to content

Instantly share code, notes, and snippets.

@richo
Created April 4, 2012 12:34
Show Gist options
  • Save richo/2300809 to your computer and use it in GitHub Desktop.
Save richo/2300809 to your computer and use it in GitHub Desktop.
class MyString(str):
def processed(self):
half1 = self[0:10].rstrip(' ')
half2 = self[11:].rstrip('\n')
return [half1, half2]
def reflect_statement(sentence):
elements = []
sensplit = []
for line in open("reflections.txt"):
mys = MyString(line)
elements.append(mys.processed())
while ' ' in sentence:
word = sentence[0:(sentence.find(' ') + 1)]
sensplit += [word.rstrip(' ')]
sentence = sentence.replace(word, '')
sensplit += [sentence]
sen = range(len(sensplit)
def punct(ptype):
if ptype in sensplit[k]:
print sensplit[k]
for k in sen:
punct('?')
punct('!')
punct(',')
print sensplit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment