In adventure games, a text parser takes typed input (a command) from the player and simplifies it to something the game can understand.
The parser makes it easier for the game's author to react on input.
separately, as the parser will have stripped the input down to something like "take flask".
For the player, the game is more flexible, as the game has a larger vocabulary, and there are fewer guess-the-verb and guess-the-noun problems.
Parsers are used in early interactive fiction games like the Zork series, and more recently in games created by systems like Inform and TADS.