Text parser
From Wikipedia, the free encyclopedia
This article needs additional citations for verification. Please help improve this article by adding reliable references. Unsourced material may be challenged and removed. (August 2007) |
In an Adventure game, a text parser takes typed input (a command) from the player and simplifies it to something the game can understand. Usually, words with the same meaning are turned into the same word (e.g. "take" and "get") and certain filler words are dropped (e.g. articles, or the "at" in "look at rock").
The Parser makes it easier for the game author to react on input. The game author does not have to check whether the command is "get the gem", "take the gem", "get gem", "take gem", "take the precious gem", and so on, because the Parser has already stripped that down to something like "take gem".
For the player, the game is more flexible. The player does not have to hunt for the right words, because the game understands more words.
Parsers were used in early Interactive Fiction like the Zork series and games by Sierra On-Line.
See also Parser in general computer science.