File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Word Singularization and Pluralization Script
2+
3+
This simple Python script allows you to input a word and get both its singular and plural forms. The script utilizes the `inflect` and `TextBlob` libraries for word processing.
4+
5+
Requirements:
6+
7+
pip install inflect textblob
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import inflect
2+
from textblob import Word
3+
4+
def main():
5+
u = input("Enter a word: ")
6+
7+
p = inflect.engine()
8+
pl = p.plural(u)
9+
10+
s = Word(u).singularize()
11+
12+
print(f"You entered: {u}")
13+
print(f"Singular form: {s}")
14+
print(f"Plural form: {pl}")
15+
16+
if __name__ == "__main__":
17+
main()
18+
19+

0 commit comments

Comments
 (0)