File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Singularize and Pluralize using NLP Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
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 number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments