static String formatHanyuPinyin(String pinyinStr, HanyuPinyinOutputFormat outputFormat)
throws BadHanyuPinyinOutputFormatCombination {
if ((HanyuPinyinToneType.WITH_TONE_MARK == outputFormat.getToneType())
&& ((HanyuPinyinVCharType.WITH_V == outputFormat.getVCharType()) || (HanyuPinyinVCharType.WITH_U_AND_COLON == outputFormat
.getVCharType()))) {
throw new BadHanyuPinyinOutputFormatCombination("tone marks cannot be added to v or u:");
}
if (HanyuPinyinToneType.WITHOUT_TONE == outputFormat.getToneType()) {
pinyinStr = pinyinStr.replaceAll("[1-5]", "");
} else if (HanyuPinyinToneType.WITH_TONE_MARK == outputFormat.getToneType()) {