Text this: A Generalized Method to Measure the Lorentz Factor from Gamma-Ray Burst Photospheric Emission