sashtech commited on
Commit
7c294cd
·
verified ·
1 Parent(s): 2b58aa4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -62,7 +62,7 @@ def capitalize_sentences_and_nouns(text):
62
 
63
  return ' '.join(corrected_text)
64
 
65
- # Function to force capitalization of the first letter of every sentence (NEW)
66
  def force_first_letter_capital(text):
67
  sentences = text.split(". ") # Split by period to get each sentence
68
  capitalized_sentences = [sentence[0].capitalize() + sentence[1:] if sentence else "" for sentence in sentences]
@@ -219,7 +219,7 @@ def rephrase_with_synonyms(text):
219
  elif token.tag_ == "VBZ": # Third-person singular present
220
  synonym = synonym + 's'
221
  elif token.pos_ == "NOUN" and token.tag_ == "NNS": # Plural nouns
222
- synonym += 's' if not synonym ends with 's' else ""
223
  rephrased_text.append(synonym)
224
  else:
225
  rephrased_text.append(token.text)
 
62
 
63
  return ' '.join(corrected_text)
64
 
65
+ # Function to force capitalization of the first letter of every sentence
66
  def force_first_letter_capital(text):
67
  sentences = text.split(". ") # Split by period to get each sentence
68
  capitalized_sentences = [sentence[0].capitalize() + sentence[1:] if sentence else "" for sentence in sentences]
 
219
  elif token.tag_ == "VBZ": # Third-person singular present
220
  synonym = synonym + 's'
221
  elif token.pos_ == "NOUN" and token.tag_ == "NNS": # Plural nouns
222
+ synonym += 's' if not synonym.endswith('s') else ""
223
  rephrased_text.append(synonym)
224
  else:
225
  rephrased_text.append(token.text)