Special Words

Collapse Content

The blog platform needs a new twist. Add a new restriction to posts so they can only use 1050 common words and their variants.

Simple Words
Guideline: You should have already created a Word model. Add the list of words located here to the words database table. The tests use the following valid words:

hello world to be or not its theyre the

If a user tries submitting invalid words, a message should be added to the post's errors. It should say "Not found:" and then list the invalid words in single quotes. For example, when a @post with the content "hello yellow lemon" is saved, @post.errors.messages[:content].first should be "Not found: 'excellent' 'yellow' 'lemon'". `

Splitting Text

Sometimes users leave out spaces. If a post is invalid, the blog should check if it can be made valid by adding spaces. If it could be made valid, it should add a suggestion to correct it after the above error message. For example, if a post is saved with "helloworld tobe" as the content, the error message should say: "Not found: 'helloworld' (try splitting into: hello world) 'tobe' (try splitting into: to be)".

Contact Us
Sign in or email us at [email protected]