public string TestCaseType(char ch, HanyuPinyinVCharType vcharType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.CaseType = HanyuPinyinCaseType.UPPERCASE; format.VCharType = vcharType; return PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]; }
public string TestVCharType(char ch, HanyuPinyinVCharType vcharType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.VCharType = vcharType; return(PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]); }
public void TestToneMarkWithUAndColon(char ch, HanyuPinyinVCharType vcharType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = HanyuPinyinToneType.WITH_TONE_MARK; format.VCharType = vcharType; PinyinHelper.ToHanyuPinyinStringArray(ch, format); }
public void TestToneMarkWithUAndColon(char ch, HanyuPinyinVCharType vcharType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = HanyuPinyinToneType.WITH_TONE_MARK; format.VCharType = vcharType; Assert.Throws <InvalidHanyuPinyinFormatException>(() => PinyinHelper.ToHanyuPinyinStringArray(ch, format)); }
public void TestVCharType(char ch, HanyuPinyinVCharType vcharType, string result) { var format = new HanyuPinyinOutputFormat { VCharType = vcharType }; Assert.Equal(result, PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]); }
public string TestCaseType(char ch, HanyuPinyinVCharType vcharType) { var format = new HanyuPinyinOutputFormat { CaseType = HanyuPinyinCaseType.Uppercase, VCharType = vcharType }; return(PinyinHelper.ToHanyuPinyinStringArray(ch, format) [0]); }
public void TestToneMarkWithUAndColon(char ch, HanyuPinyinVCharType vcharType) { var format = new HanyuPinyinOutputFormat { ToneType = HanyuPinyinToneType.WithToneMark, VCharType = vcharType }; Assert.Throws <InvalidHanyuPinyinFormatException> (() => PinyinHelper.ToHanyuPinyinStringArray(ch, format)); }
public string TestWithToneNumber( char ch, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = HanyuPinyinToneType.WITH_TONE_NUMBER; format.VCharType = vcharType; format.CaseType = caseType; return(PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]); }
public void TestWithToneNumber(char ch, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType, string result) { var format = new HanyuPinyinOutputFormat { ToneType = HanyuPinyinToneType.WITH_TONE_NUMBER, VCharType = vcharType, CaseType = caseType }; Assert.Equal(result, PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]); }
public string[] TestCharWithMultiplePronouciations( char ch, HanyuPinyinToneType toneType, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = toneType; format.VCharType = vcharType; format.CaseType = caseType; return(PinyinHelper.ToHanyuPinyinStringArray(ch, format)); }
public string TestWithToneNumber( char ch, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType) { var format = new HanyuPinyinOutputFormat { ToneType = HanyuPinyinToneType.WithToneNumber, VCharType = vcharType, CaseType = caseType }; return(PinyinHelper.ToHanyuPinyinStringArray(ch, format) [0]); }
public string[] TestCharWithMultiplePronunciations( char ch, HanyuPinyinToneType toneType, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType) { var format = new HanyuPinyinOutputFormat { ToneType = toneType, VCharType = vcharType, CaseType = caseType }; return(PinyinHelper.ToHanyuPinyinStringArray(ch, format)); }
public void TestCharWithMultiplePronouciations( char ch, HanyuPinyinToneType toneType, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType, string[] result) { var format = new HanyuPinyinOutputFormat { ToneType = toneType, VCharType = vcharType, CaseType = caseType }; Assert.True(Enumerable.SequenceEqual(result, PinyinHelper.ToHanyuPinyinStringArray(ch, format))); }
public string[] TestCharWithMultiplePronouciations( char ch, HanyuPinyinToneType toneType, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = toneType; format.VCharType = vcharType; format.CaseType = caseType; return PinyinHelper.ToHanyuPinyinStringArray(ch, format); }
/** * Define the output format of character 'ü' * * @param charType * the output format of character 'ü' * * @see HanyuPinyinVCharType */ public void setVCharType(HanyuPinyinVCharType charType) { vCharType = charType; }
/** * Restore default variable values for this class * * Default values are listed below: * * <p> * HanyuPinyinVCharType := WITH_U_AND_COLON <br> * HanyuPinyinCaseType := LOWERCASE <br> * HanyuPinyinToneType := WITH_TONE_NUMBER <br> */ public void restoreDefault() { vCharType = HanyuPinyinVCharType.WITH_U_AND_COLON; caseType = HanyuPinyinCaseType.LOWERCASE; toneType = HanyuPinyinToneType.WITH_TONE_NUMBER; }
public string TestWithToneNumber( char ch, HanyuPinyinVCharType vcharType, HanyuPinyinCaseType caseType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = HanyuPinyinToneType.WITH_TONE_NUMBER; format.VCharType = vcharType; format.CaseType = caseType; return PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]; }
/// <summary> /// Restore default variable values for this class /// 重新加载本类的默认变量值 /// /// Default values are listed below: /// 默认变量值如下 /// <p> /// HanyuPinyinVCharType := WITH_U_AND_COLON <br /> /// HanyuPinyinCaseType := LOWERCASE <br/> /// HanyuPinyinToneType := WITH_TONE_NUMBER <br/> /// </p> /// </summary> public void RestoreDefault() { vCharType = HanyuPinyinVCharType.WITH_U_AND_COLON; caseType = HanyuPinyinCaseType.LOWERCASE; toneType = HanyuPinyinToneType.WITH_TONE_NUMBER; }
public void TestToneMarkWithUAndColon(char ch, HanyuPinyinVCharType vcharType) { HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat(); format.ToneType = HanyuPinyinToneType.WITH_TONE_MARK; format.VCharType = vcharType; PinyinHelper.ToHanyuPinyinStringArray(ch, format); }