Words don't excite the same bits of our brains as other physical experiences, so full knowledge of red through words and higher level thoughts is not enough for Mary. But assuming she has perfect knowledge of the the interaction of red wavelength with the eye and perfect knowledge of how the sensory input interacts with her brain, she could stick theoretically optimal electrodes in exactly the right places (or specifically tailored psychedelic drugs) and virtually experience and learn about red before actually seeing it.