green commited on
Commit
a883e93
1 Parent(s): 057b299

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -176,6 +176,12 @@ def show_length_graph():
176
  plt.title('Original to Summarized Lengths in Space-Separated Tokens')
177
  #ax.hist(arr, bins=20)
178
  st.pyplot(fig)
 
 
 
 
 
 
179
 
180
  # These could be passed through the command line
181
  # or read from a config file.
@@ -296,4 +302,9 @@ with st.form(key='columns_in_form'):
296
 
297
  st.subheader("Issues: ")
298
  st.write("Repetition:")
 
 
 
 
 
299
 
 
176
  plt.title('Original to Summarized Lengths in Space-Separated Tokens')
177
  #ax.hist(arr, bins=20)
178
  st.pyplot(fig)
179
+
180
+ def check_for_word_and_word(in_string):
181
+ m = re.search(r'(\w\w+)\sand\s\1', in_string)
182
+ if m is not None:
183
+ return m.group()
184
+ return None
185
 
186
  # These could be passed through the command line
187
  # or read from a config file.
 
302
 
303
  st.subheader("Issues: ")
304
  st.write("Repetition:")
305
+ rep_check = check_for_word_and_word(digestor.text)
306
+ if rep_check is not None:
307
+ st.write(f"Following phrases repeat: {rep_check}")
308
+ else:
309
+ st.write("No repetition detected.")
310