The hard-coded dictionary wouldn't be much stranger than Brotli's:
https://news.ycombinator.com/item?id=27160590
You can use a BPE variant like SentencePiece to identify these patterns rather than hard coding them.