Generalize annotation detection.