Purification of a single-photon nonlinguarity