Full specification available on request

I need a small algorithm. Any volunteers?

I am getting more and more tangled in my attempts to write local English. The solution is custom dialect editions of Dervala.net for Irish, British, Canadian, and American readers. Or for days when I lurch more towards one nation than another.

I want to assign country-specific words and phrases in a custom dictionary and grammar check tool. Simple spelling differences would be covered: color/colour, realize/realise. I’d include basic vocabulary changes, such as couch/sofa/chesterfield or gobshite/pillock/shit disturber/idiot. The tool would strip out (or add) irritating American grammar, such as the dastardly serial comma (apples comma oranges comma and comma pears). It might even swap brand names: Irish Mars Bar for American Milky Way (it’s the same damn candy bar!) And pop culture references: with a single click The Magic Roundabout morphs into Fortycoats, Degrassi Junior High, or Mr Rogers’ Neighborhood. The All Ireland into Superbowl, Grey Cup, or Test Series.

The Canadian version would substitute Cold out, eh? for Hello, but only from November to April. The Irish version would say Desperate weather we’re having.

I need this tool because Canadian English is a mess. Take ‘Tire Centre’. American spelling of ‘tire’, British spelling of ‘centre’. They pay for gas with a cheque, not petrol with a check. They eat potato chips, not crisps, but porridge, not oatmeal. (1) In fact, Canadian English sounds just like the hodge-podge dialect I’ve always served up right here on this website: no wonder I feel at home.

Oh, and until you figure out full context-sensitivity, give me some keyboard shortcuts to turn your wizardry on and off as I type, so that I don’t tyre of manual corrections.

(1) Examples from How to be Canadian, by Will Ferguson & Ian Ferguson. Yes, I’m trying.