Optical properties of one-dimensional semiconductors and conjugated polymers