Hierarchical Prompt Learning for Image- and Text-Based Person Re-Identification