Text this: Chip-scale sensor for spectroscopic metrology