Our Junior Junior Developer
Patterns in Titles
Well it turns out most words are capitalized in titles, so it might be easier to program for what to keep lower case and capitalize everything else by default. This would work for almost all titles
Regex for Non-Capitalized Words
Well this is great we can just make a Regex for articles, coordinating conjunctions, and prepositions.
Prepositions are tricky since there are 150 in the English language, but we don’t need to get the edge cases.There about 12 most often used prepositions. After examining these only a couple of these occur regularly.
Also we must account for special words in tech like AJAX, and jQuery that have special capitalizations.
This will make more sense once we hop in to some code.
Decoupling the functions gives us room the extend/shrink the regex separately, and decouple it from the implementation
Now we can move ahead on to addressing the special tech words in a similar fashion
Bringing It Together
Ok so now we have the brass, percussion, strings. Unfortunately they’re currently separate and isolated .Let’s now combine it into a beautiful orchestra.
Does it Work ?
Now if all works as expected we should be able to transform all of our titles in just a couple functions.