ireneng commited on
Commit
931e1e6
1 Parent(s): 34a8bfe

change cut function to stop only at period

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -73,7 +73,7 @@ def search_book_description(title):
73
 
74
  # function to ensure summaries end with punctuation
75
  def cut(sum):
76
- last_punc_idx = max(sum.rfind(p) for p in string.punctuation)
77
  output = sum[: last_punc_idx + 1]
78
  return output
79
 
 
73
 
74
  # function to ensure summaries end with punctuation
75
  def cut(sum):
76
+ last_punc_idx = max(sum.rfind("."))
77
  output = sum[: last_punc_idx + 1]
78
  return output
79