-
Notifications
You must be signed in to change notification settings - Fork 857
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
How to turn whole sentence into singular? #134
Comments
PS: I encounter similar issues when I try to turn a whole sentence in past tense into present with the PresentVerbInflector. |
I think the problem is that The inflectors work off of a set of rules in most cases, so if you give the noun inflector a verb it will likely treat it is a noun and apply the rules (getting |
Thanks @kkoch986 Hmmm.... what are wordnet and POS? Is there a function which tells me if the word is a noun or a verb? |
Sorry, could have been more clear. POS stands for part-of-speech meaning is it a verb, noun, adjective etc... Wordnet is a database of english words and it contains a lot of useful information about them see http://wordnet.princeton.edu/ and here for more on that. Once you've configured natural to use wordnet (as per the second link above) you can get the parts of speech by doing something like this:
Let me know if that helps, I think a good POS tagger (something that takes a word and returns its part of speech) or a good sentence parser (something that takes a sentence and gives some information about what words make up what parts of the sentence structure) are important additions to natural. Hopefully both will be coming soon. -Ken |
Thanks @kkoch986 - I will give this a try but first, let me ask you a couple of questions:
I need all that for a mad experiment. To interpret English sentences into sign language ;) |
@binarykitchen I love both the lookup feature enhancement and the "mad experiment" keep me posted on your progress and let me know if i can help in some way. I'll try to get to working on that lookup feature but its not quite at the top of my list right now. I would be more than happy to merge it in if you arrive at the solution before i do.
|
@kkoch986 Thanks Ken! Go ahead, there is no rush. Whenever you have enhanced the code, I will continue with my mad experiment. |
Hello again
I'd like to turn all words of a sentence into singular.
For example
my dog has lots of flees
should become[ 'my', 'dog', 'has', 'lots', 'of', 'flee' ]
Here the code:
which outputs:
[ 'my', 'dog', 'ha', 'lots', 'of', 'flee' ]
Almost correct. But why
ha
? And nothas
?The text was updated successfully, but these errors were encountered: