text.hpp: refactor ruleset into a generic pronunciation interface