Node.js as an alertnative to Lisp ;-)
✓ Published0🌍 Public
RRandomEtc
Last edited Dec 24, 2010
Created on Dec 24, 2010
This example demonstrates a Node.js command-line tool that maps numeric phone-keypad input to dictionary words, following the classic Lisp challenge from Norvig. It reads a dictionary file and an input stream, building a lookup table of character-to-digit mappings and then recursively matching digit sequences against encoded words. The implementation uses Node.js core APIs like `fs.readFileSync` and `fs.createReadStream` for file I/O, processing the input line-by-line via stream events, and outputs matching words to the console. It highlights the practicality of JavaScript for text-processing puzzles.
AI-generated description