
Determinging if a sentence is imperative(natural language processing)...
Is there a remotely easy way of doing this? I don''t see one, aside from checking if the first word is a verb, in which case I''d need to attach a dictionary to my bot... I suppose I could check for some common imperative words, but there might be a better solution.
<- Cow Soft, free software I''ve made
"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald

-~-The Cow of Darkness-~-
Unless you know the parts of speech, there''s not much way to tell.
"Get down."
"I get down."
Humans recognize imperatives by familiar words/structures, and tone. For written words, there''s no tone aside from context, which is all learned anyway.
I like pie.
"Get down."
"I get down."
Humans recognize imperatives by familiar words/structures, and tone. For written words, there''s no tone aside from context, which is all learned anyway.
I like pie.
[sub]My spoon is too big.[/sub]
I think the *real* question is how exact do you want this to be? You could do it with Regular expressions if you wanted but it wouldn't be very exact. You are left with variations on:
- Pattern Matching
- Familiarity
- Familiarity + Pattern Matching
I mean simple:
if word then is imperative
if word + space then is imperative
if word + space + word then is imperative
etc
Also, instead of looking for real words, you could search for sounds in words - 'ing', 'ite', 'ime', 'ght'. And cap at the start [C][L][L][Dot] (C=Cap, L=Lower).
[edited by - Manip on March 10, 2004 6:51:23 AM]
- Pattern Matching
- Familiarity
- Familiarity + Pattern Matching
I mean simple:
if word then is imperative
if word + space then is imperative
if word + space + word then is imperative
etc
Also, instead of looking for real words, you could search for sounds in words - 'ing', 'ite', 'ime', 'ght'. And cap at the start [C][L][L][Dot] (C=Cap, L=Lower).
[edited by - Manip on March 10, 2004 6:51:23 AM]
There are no "common imperative words" in English really. English - like French and probably many other Western languages - structures imperative sentences by using the "you" form (2nd person) of the verb while omitting the subject (which is "you"). Apart from that there''s often little or no difference between the sentences; eg. "Play the guitar." vs "I play the guitar".
Unless you''re going to start using a dictionary and checking the parts of speech, then you''re being a bit liberal with the term "natural language processing"
[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
Unless you''re going to start using a dictionary and checking the parts of speech, then you''re being a bit liberal with the term "natural language processing"

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
quote:
Original post by Kylotan
There are no "common imperative words" in English really. English - like French and probably many other Western languages - structures imperative sentences by using the "you" form (2nd person) of the verb while omitting the subject (which is "you"). Apart from that there''s often little or no difference between the sentences; eg. "Play the guitar." vs "I play the guitar".
Unless you''re going to start using a dictionary and checking the parts of speech, then you''re being a bit liberal with the term "natural language processing"![]()
Yes, but checking to see if the first word of a sentence is a word like "help," "give," or "tell" will be a fairly good indicator. Also, how did I get "nearly banned"?

"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald
-~-The Cow of Darkness-~-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement