Spaces:
Running
Running
Update app.py
Browse files
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
|
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
|
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)
|