This is a simple straightforward project for any javascript programmer. I want you to create a script that:
1) Takes full article text
2) For every 3 consecutive words randomly convert 1 word into Spun ASCII format. e.g this is the first sentence in my article.
In that sentence there 2 groups of 3 words e.g 'this is the' and 'first sentence in'. The script should randomly pick one
word in each and convert it to spun ASCII.
3) Protect words - The script should allow for a series of protected words not to convert. e.g in the above if the word 'is' was in the list of protected words then it will not be converted and another word will be randomly picked from the group to convert. If all words in a group are protected it can skip that group and do the next.
3) So what is spun ASCII? The spun ASCII format is each letter in the word + the ASCII character in side spin tags {|}
Let's say the script pulls out the word 'this' from the first group above and 'In' in the next. The ASCII spun output of each are:
this = {t|t}{h|h}{i|i}{s|s}
In = {i|i}{n|n}
4) The script should then replace the randomly chosen word in the article with the Spun ASCII output e.g
this is the first sentence in my article = {t|t}{h|h}{i|i}{s|s} is the first sentence {i|i}{n|n} my article
Notes:
The random word should be replaced only in the group it was randomly picked from with the ASCII output, not every concurrence of the word throughout the article. e,g in the above the ASCII spun word should replace that word in that group only. Every other occurrence of the word throughout the article remains as is unless it is randomly picked in another group.
Script must respect new lines, paragraphs etc so the final output is the same as the original except for the replaced ASCII spun words.
I have explained this in a lot of detail. In reality this is a lot easier. I will supply you with working code that can already take the article, get groups of X words and take the random word for each.
Your job is to edit it to do the above. This is probably 5-10 lines of code max. The cleaner the code the better.
Look forward to working with you on this project and larger projects if you complete this perfectly.
Kevin