Text this: Polarization photodetectors with configurable polarity transition enabled by programmable ferroelectric-doping patterns