-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add spell checker project #24
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Simple
It doesn't ask for tests. I think we probably want something, even just console.asserts?
Co-authored-by: Sally McGrath <[email protected]>
Co-authored-by: Sally McGrath <[email protected]>
Not sure how I missed the testing & lighthouse points, but have now copied them over. Agree that they are both requirements that we want. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did this project, it's cute, but assuming we're not requiring re-styling input to show invalid words, it feels a little simple? My implementation is ~20 lines of ~trivial code.
If we are requiring re-styling input... That's an interesting, but quite big challenge...
|
||
Your task is to build your own spell checker for a simplified language called ["Basic English"](https://en.wikipedia.org/wiki/Basic_English) that contains a much smaller set of words than regular English. Use the list provided in `words.json`. | ||
|
||
Make a website where a user can write some text and then check if the text is valid Basic English. You must **focus on HTML and JavaScript**. Some CSS can be used, but the website's design **is not the focus of the assessment**. We will assess you on correct logic, not on a pretty UI that is incomplete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make a website where a user can write some text and then check if the text is valid Basic English. You must **focus on HTML and JavaScript**. Some CSS can be used, but the website's design **is not the focus of the assessment**. We will assess you on correct logic, not on a pretty UI that is incomplete. | |
Make a website where a user can write some text and then check if the text is valid Basic English. You must **focus on HTML and JavaScript**. Some CSS can be used, but the website's design **is not the focus of the assessment**. We will assess you on correct logic. You will not pass if you produce a pretty UI that has missing or incorrect logic. |
|
||
Your website should display an input, which allows the user to write some text. Your website should also have some way of triggering a spell check on the text that the user has written. | ||
|
||
When the spell check is triggered, your website should check every word that the user has typed to see if it exists in the Basic English word list that we have provided (in `words.json`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are we expecting them to pull in words.json
? Copying + pasting the array into their code? Importing it somehow?
|
||
When the user changes the text in the input, the warning about misspelled words should be cleared. | ||
|
||
The input text can sometimes include punctuation (such as commas or full stops). Your website should not identify words that include some punctuation as spelling mistakes. So for example, "make a cake, please" will not highlight "cake" as a spelling mistake. However, if a word that is not in the Basic English word list and is next to some punctuation, it still should be highlighted as a spelling mistake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The input text can sometimes include punctuation (such as commas or full stops). Your website should not identify words that include some punctuation as spelling mistakes. So for example, "make a cake, please" will not highlight "cake" as a spelling mistake. However, if a word that is not in the Basic English word list and is next to some punctuation, it still should be highlighted as a spelling mistake. | |
The input text can sometimes include punctuation (such as commas or full stops). Your website should not identify words that include some punctuation as spelling mistakes. So for example, "make a cake, please" will not highlight "cake" as a spelling mistake. However, if a word that is not in the Basic English word list and is next to some punctuation (e.g. "cakez,"), it still should be highlighted as a spelling mistake. |
"lip", | ||
"liquid", | ||
"list", | ||
"little (less, least)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably split+flatten this?
"mountain", | ||
"mouth", | ||
"move", | ||
"much (more, most)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably split+flatten this?
|
||
When the user changes the text in the input, the warning about misspelled words should be cleared. | ||
|
||
The input text can sometimes include punctuation (such as commas or full stops). Your website should not identify words that include some punctuation as spelling mistakes. So for example, "make a cake, please" will not highlight "cake" as a spelling mistake. However, if a word that is not in the Basic English word list and is next to some punctuation, it still should be highlighted as a spelling mistake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to specifically cover punctuation in words?
e.g. is I've invalid? Is deep-cut (deep and cut are both valid)?
|
||
When the spell check is triggered, your website should check every word that the user has typed to see if it exists in the Basic English word list that we have provided (in `words.json`). | ||
|
||
If there are any words that aren't in the Basic English word list, you should consider those words as a spelling mistake. All spelling mistakes should be presented to the user underneath the input, along with some text explaining that the words are misspelled. They should be highlighted in some way that makes it obvious that there is a spelling mistake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused about this wording, specifically around highlighting.
Is appending "The following words are misspelled: veritable, cheeze" under the input sufficient for this to pass? Or does highlighting suggest the input should also be restyled in some way?
|
||
When the user changes the text in the input, the warning about misspelled words should be cleared. | ||
|
||
The input text can sometimes include punctuation (such as commas or full stops). Your website should not identify words that include some punctuation as spelling mistakes. So for example, "make a cake, please" will not highlight "cake" as a spelling mistake. However, if a word that is not in the Basic English word list and is next to some punctuation, it still should be highlighted as a spelling mistake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to enumerate what characters we consider punctuation?
- The website has a way for the user to triggering a spell check | ||
- When triggered, the spell check should check every word in the input to see if it exists in the Basic English word list | ||
- If the word does not exist in the word list, then it should be highlighted below the input as a spelling mistake | ||
- It should be obvious to the user that there is a spelling mistake, both with visuals and some explanatory text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to specify the behaviour if there are no spelling mistakes? e.g. display a positive "All good" message vs just showing nothing special?
I think this is probably over the line of complexity - it's a surprisingly difficult task, often even for quite senior folks!
I think we touched on this on a call and my memory is that it sounded like you had some ideas about ramping up the difficulty a bit? (Or possibly could have been Sally?) If that's not correct, then I think I might lean towards closing this PR. I think this works well as an interview question as it's simple to get something working but difficult to extend/make scalable. EDIT: I think we need to answer this question before addressing the specific points you made above - no point in addressing them unless we know we want to keep this :) |
Agreed!
I think off the top of my head possible extensions were...
They're all reasonably minor additions/tweaks, but maybe all of them together equal a reasonable individual project? |
Changelist
Adds a spell checker project.
I expect this would be a solo project - at least as it stands - but welcome feedback on extensions etc. I initially thought this might be a bit bigger in scope, but many of the interesting aspects of this project are in asking questions about their approach (e.g. "what might happen if you replaced Basic English with real English?"), and I think those are difficult to write a very precise rubric like I think we're aiming for here. Having said that I still think this is a decent standalone project.