Finite State Automata & Lexical Parsing
“Natural Language Processing in Classical Text Adventures”
Parser Automata Nlp Simulator
Rheological modeling & dynamic physical mapping of this topic
Input Control Parameters
Adjusts molecular kinetic movement and thermal agitation coefficients.
Sets the percentage of colloidal particles suspended within the system.
Regulates internal shear resistance and electrostatic clay platelet binding.
Microscopic Particle Lattice
System Calculations
1String Tokenization and Lexing
Early text parsers read player input as a raw stream of ASCII characters. The lexer stripped out noise words ('THE', 'A', 'WITH') and tokenized the remaining characters into semantic components: Verbs and Nouns.
- Noise Filtering: Discards articles and prepositions to simplify parsing.
- Token Mapping: Matches words to internal integer IDs ('KILL' = 4, 'ORC' = 102).
2Syntax Trees and Verb-Noun Matching
The parsed tokens are assembled into simple syntax trees. A context-free grammar checks if the token order conforms to game rules (e.g., Verb-Noun or Verb-Noun-Preposition-Noun).
- CFG Grammar: Rules like 'Command -> Verb Noun' govern valid inputs.
- Semantic Resolution: Resolving ambiguous inputs like 'GET ALL' using inventory lists.
3Finite State Machine Synchronization
The game world is represented as a collection of nodes in a finite state machine. Commands trigger transition functions that validate pre-requisites and mutate the central world state.
- FSM Transitions: Moving rooms shifts the 'Player Position' node.
- Action Mutators: Successfully unlocking a door changes its state to 'OPEN'.