Some medications can cause problems with taste. Metronidazole in particular, which you're quite likely to have been given for pneumonia. Taste goes back to normal a day or two after you stop the antibiotics.