Text this: Complex degenerate metrics in general relativity: a covariant extension of the Moore–Penrose algorithm