Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plural vs Singular names #7

Open
martinschaef opened this issue Nov 30, 2016 · 2 comments
Open

Plural vs Singular names #7

martinschaef opened this issue Nov 30, 2016 · 2 comments
Assignees

Comments

@martinschaef
Copy link
Contributor

Going through a bunch of results, I think we have to distinguish plural from singular names for clustering of classes and fields.
Is there a good way to determine if a word (or class name) is singular or plural that works well with the stemming that we do (apart from checking if it ends on 's' before stemming)?

@hsanchez
Copy link
Contributor

"Is there a good way to determine if a word (or class name) is singular or plural that works well with the stemming that we do (apart from checking if it ends on 's' before stemming)?"

You can play with the class Noun (which is part of the library that I am using to extract frequent and typical words). Here is the source code (latest version): https://github.com/vesperin/introspector/blob/cleanup2/src/main/java/com/vesperin/text/nouns/Noun.java

Example

System.out.println(Noun.get().isSingular("Trial") => true
System.out.println(Noun.get().isPlural("Trial") => false
// or

if(Noun.get().isSingular("Trial")){
  System.out.println(Noun.get().pluralOf("Trial")); => Trials
  System.out.println(Noun.get().singularOf("Trial")); => Trial
}

Side comment: Maybe the name of this class should "Term". instead of Noun..

@hsanchez
Copy link
Contributor

You can use it within the clusterer project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants