nontGcob commited on
Commit
167c0f2
1 Parent(s): 179a07d

fix AttributeError: 'list' object has no attribute 'split'

Browse files
Files changed (1) hide show
  1. model.py +5 -4
model.py CHANGED
@@ -67,10 +67,11 @@ def model(passage, level):
67
  txt = passage
68
 
69
  # sentence_cutters = [".", "!", "?"]
70
- if ("." in txt) or ("!" in txt) or ("?" in txt):
71
- txt = (txt.split(".").split("!").split("?"))
72
- else:
73
- txt = txt
 
74
 
75
  text_dict = {}
76
  for n in txt:
 
67
  txt = passage
68
 
69
  # sentence_cutters = [".", "!", "?"]
70
+ # if ("." in txt) or ("!" in txt) or ("?" in txt):
71
+ txt = txt.replace("!", ".").replace("?", ".")
72
+ txt = txt.split(".")
73
+ # else:
74
+ # txt = txt
75
 
76
  text_dict = {}
77
  for n in txt: