Disclaimer: This isn't my challenge but ThisGuy said I was OK to post.
Occasionally I want to make a word into it's opposite, like
happiness goes to
unhappiness. Unfortunately when this happens, my brain will sometimes go blank. Then one day, after yet another this happening, I thought to my self "This is what programs are for!"
As the English language has many exceptions, I have created a list which contains the prefix for the starting letter
q or h -> dis- (honest -> dishonest) l -> il- (legal -> illegal) m or p -> im- (mature -> immature) r -> ir- (responsible -> irresponsible) everything else -> un- (worthy -> unworthy)
Given an input as a string, make the string into its negative and output the result. You can assume that all the inputs given will fit the above rules. Submissions may be programs or functions, not snippets.
A single string, taken either as a parameter or from STDIN
The negated form of that string, conforming to the above rules
How to Win
This is a code-golf so shortest code wins