Examine the chapter06_spellcheck
example code in the workbook’s git repository.
-
Run the project on your computer
-
How does the code work? You might experiment in an interactive
node
session in your operating system’s terminal or read API documentation:-
The
fs
andpath
modules are in the Node.js documentation. -
For the
.split
and.match
functions (onString.prototype
) andSet
objects, you can refer to the Mozilla Developer Network. -
Feel free to ignore the meaning of
/([^A-Za-z']+)/
and/[^A-Za-z']+/
: they are both regular expressions in JavaScript.
-
-
How would you categorize the lines of code into layers?
-
Can you separate the spell checker code into three layers?
Keep refining your solution until you are happy with it!
-
What did you notice during the process of adding layering to the spell check?
-
Are there parts of the spell-checking code that other people might have categorized differently?
-
Does layering improve the application? Do you feel that the additional complexity is warranted?