Esempio n. 1
0
 public string TestCaseType(char ch, HanyuPinyinVCharType vcharType)
 {
     HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
     format.CaseType = HanyuPinyinCaseType.UPPERCASE;
     format.VCharType = vcharType;
     return PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0];
 }
Esempio n. 2
0
        public string TestVCharType(char ch, HanyuPinyinVCharType vcharType)
        {
            HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();

            format.VCharType = vcharType;
            return(PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]);
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        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));
        }
Esempio n. 5
0
        public void TestVCharType(char ch, HanyuPinyinVCharType vcharType, string result)
        {
            var format = new HanyuPinyinOutputFormat
            {
                VCharType = vcharType
            };

            Assert.Equal(result, PinyinHelper.ToHanyuPinyinStringArray(ch, format)[0]);
        }
Esempio n. 6
0
        public string TestCaseType(char ch, HanyuPinyinVCharType vcharType)
        {
            var format = new HanyuPinyinOutputFormat {
                CaseType  = HanyuPinyinCaseType.Uppercase,
                VCharType = vcharType
            };

            return(PinyinHelper.ToHanyuPinyinStringArray(ch, format) [0]);
        }
Esempio n. 7
0
        public void TestToneMarkWithUAndColon(char ch, HanyuPinyinVCharType vcharType)
        {
            var format = new HanyuPinyinOutputFormat {
                ToneType  = HanyuPinyinToneType.WithToneMark,
                VCharType = vcharType
            };

            Assert.Throws <InvalidHanyuPinyinFormatException> (() => PinyinHelper.ToHanyuPinyinStringArray(ch, format));
        }
Esempio n. 8
0
        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]);
        }
Esempio n. 9
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]);
        }
Esempio n. 10
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));
        }
Esempio n. 11
0
        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]);
        }
Esempio n. 12
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));
        }
Esempio n. 13
0
        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)));
        }
Esempio n. 14
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);
 }
 /**
  * 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;
 }
Esempio n. 17
0
 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];
 }
Esempio n. 18
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;
 }
Esempio n. 19
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);
 }