Yeah, I did it once for a text adventure, though I don't think that I still have the code.
Here is the idea:
All together there are 7 word banks:
1) A general list of all words (used for correct spelling and is downloadable)
2-7) A list of different words for different actions based off 1 for each of the 5 senses and 1 extra for the GO category (since go doesn't fall into anything else, but is still necessary)
Then, there is a file that contains a list of available nouns (names for your mafia members or whatever)
The code works like this:
First sweep of the command breaks the sentence into words by scanning through until a space is found and it stores each word into an array for easy referencing.
Second sweep checks the words against the word bank to check for appropriate words (so the user won't be able to type "Vinny adsfsdf;lsafd Carlos shdlf;ajsd;f attack sdl;fakjsd;fl them" and get Vinny and Carlos to attack someone). If a word fails, everything is done and the bad word is returned with a "That does not compute" style message.
Third Sweep will find the action to do. This is done by comparing each word to the words in your 6 actions word banks (You could probably deviate from the 5 senses and a go but this is how mine was structured). Once the verb is identified, a flag is set to the appropriate action code. If no verb is found, all further sweeps are considered done and the return message is something along the lines of "Whaddya wan us ta do boss?"
Fourth sweep will check the words to identify the nouns. In your case, the nouns BEFORE the action (which you have the word number for stored in a variable) will identify the Mafia members and the nouns AFTER the action will identify the target. If either a Source (Mafia Members) or a Target are missing, you get a "WHO??" message. To figure out which nouns are which, the words are compared to the noun files (could be split into "Mafia" and "Enemy" or even a file for each possible target, should you want a diplomacy aspect to the game, so that you could keep track of families).
So, the structure after would be: Source Action Target, thus eliminating useless words like "THE" "and" and "uh". Also, as each source/target is found, its flag should either be stored in a variable or an array (depending on if you want to have multiple sources and targets for any give command).
This worked for the text adventure quite well. I was able to type "Walk west" to have my character move west or "Look at apple" to well, you get the idea.
It could probably be simplified further and done in a single check, but I made it at school and wrote it all down in a spiral bound notebook, so it was kinda messy to begin with. The important thing is that it worked.
Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose