1 min readFeb 11, 2018
There are a number of ways of doing this more efficiently. I would be hesitant to claim myself that I am ‘data informed’ (although how else one can be informed is a relevant question). However, given this is by no means the optimum solution, I’d be doubly hesitant to make that claim.
The main fail in your design is that it doesn’t, like most context creation, take into account exceptions to the patterns matched.