Singularize: Depluralize English Words
Singularize: Depluralize English Words
This project aims to create a Singularize function that takes a “plural” word and makes it singular. Grammar rules for singularizing or pluralizing words are not “strict” and often have a lot of exceptions, overlapping rules, and exceptions to exceptions. Coming up with heuristics for Pluralizing or Singularizing is thus a very challenging task. We tackle this problem from different approach. One approach is to use the rich data that already exists in Wolfram Language, specifically, InflectedForms of WordData to come up with a function for Singularize. We test this method exhaustively on all the words, identify potential problems and discuss some “mild” limitations of this approach.
Further, we decided to use Wolfram Language’s already implemented Pluralize function, and instead of re-inventing the wheel, singularize function could be obtained by simply reversing the rules of the function, and showing a simple proof of concept.
Next, perhaps the most challenging question to ask is, are the 2437 “exceptions” in the Pluralize functions are truly exceptions? A deeper dive into the patterns show that there are patterns in the exceptions that can be identified to create new rules or modify existing ones. So, the steps are the following- identify the pattern, create a new rule or modify the existing one, find out exceptions to the rule, add the new rule or modify the existing rules, and add the exceptions to the newly created/modified rule back to the dictionary of exceptions. However, there’s a catch, the exception that you identified in the newly created/modified rule, might also not be a true exception, i.e. they might actually follow another existing rules or another new rule you create (or create in the future). That’s why this section of the project is titled “Inception of Exceptions”.
After thorough testing of each rule, we finally create the new rules with less exceptions and see it work!
Further, we decided to use Wolfram Language’s already implemented Pluralize function, and instead of re-inventing the wheel, singularize function could be obtained by simply reversing the rules of the function, and showing a simple proof of concept.
Next, perhaps the most challenging question to ask is, are the 2437 “exceptions” in the Pluralize functions are truly exceptions? A deeper dive into the patterns show that there are patterns in the exceptions that can be identified to create new rules or modify existing ones. So, the steps are the following- identify the pattern, create a new rule or modify the existing one, find out exceptions to the rule, add the new rule or modify the existing rules, and add the exceptions to the newly created/modified rule back to the dictionary of exceptions. However, there’s a catch, the exception that you identified in the newly created/modified rule, might also not be a true exception, i.e. they might actually follow another existing rules or another new rule you create (or create in the future). That’s why this section of the project is titled “Inception of Exceptions”.
After thorough testing of each rule, we finally create the new rules with less exceptions and see it work!
Section 1: Data Method
Section 1: Data Method
Section 2: Rule Method (Reverse Pluralize Rules)
Section 2: Rule Method (Reverse Pluralize Rules)
Section 3: Organize the existing IrregularRules:
Section 3: Organize the existing IrregularRules:
Section 4: Create the new rules, finally!
Section 4: Create the new rules, finally!
Concluding remarks
Concluding remarks
While the first two sections have a definitive answer to completion, the third section is an iterative way of thinking, matching existing patterns and rules and at best can be work in progress (for any foreseeable future). However, the third approach has a major benefit to the existing way of just adding word to the ever-increasing exception categories (currently at 2437). When you are identifying and creating the new rules from the existing exception patterns, the probability of WL users keep identifying niche cases will keep decreasing, as a result, could potentially lead to a more robust system.
Currently, in just this phase we have reduced the exceptions from 2437 to 557.
Additionally, we have also added previously non existent exceptions by carefully testing each of the rules/exception patterns and matching it with the built-in dictionary.
Currently, in just this phase we have reduced the exceptions from 2437 to 557.
Additionally, we have also added previously non existent exceptions by carefully testing each of the rules/exception patterns and matching it with the built-in dictionary.
Keywords
Keywords
Acknowledgment
Acknowledgment
I would like to thank Dr. Wolfram for the idea of the function and for the developers of Pluralize for the initial ideas to make this function. And I would like to thank one of my coworkers for some motivation.
References
References
◼
Paper: https : //users.monash.edu/~damian/papers/HTML/Plurals.html
◼
Grammarly: https://www.grammarly.com/blog/plural-nouns/