choose prefix based on document context