Text this: Efficient hardware error correction with hybrid on-offline configuration algorithm for optical processor