當前位置: 首頁>>代碼示例>>C#>>正文


C# WordLibrary.GetPinYinString方法代碼示例

本文整理匯總了C#中Studyzy.IMEWLConverter.Entities.WordLibrary.GetPinYinString方法的典型用法代碼示例。如果您正苦於以下問題:C# WordLibrary.GetPinYinString方法的具體用法?C# WordLibrary.GetPinYinString怎麽用?C# WordLibrary.GetPinYinString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Studyzy.IMEWLConverter.Entities.WordLibrary的用法示例。


在下文中一共展示了WordLibrary.GetPinYinString方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetCodeOfWordLibrary

 public IList<string> GetCodeOfWordLibrary(WordLibrary str, string charCodeSplit = "")
 {
     if (str.CodeType == CodeType.Pinyin)
     {
         return new List<string> {str.GetPinYinString("", BuildType.None)};
     }
     return CollectionHelper.Descartes(str.Codes);
 }
開發者ID:wadexiao,項目名稱:imewlconverter,代碼行數:8,代碼來源:PhraseGenerater.cs

示例2: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            //StringBuilder sb = new StringBuilder();

            string str = wl.GetPinYinString("'", BuildType.LeftContain) + " " + wl.Word;

            return str;
        }
開發者ID:studyzy,項目名稱:imewlconverter,代碼行數:8,代碼來源:SougouPinyin.cs

示例3: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();

            sb.Append(wl.GetPinYinString("'", BuildType.None));
            sb.Append("\t");
            sb.Append(wl.Word);
            return sb.ToString();
        }
開發者ID:studyzy,項目名稱:imewlconverter,代碼行數:9,代碼來源:SinaPinyin.cs

示例4: GetCodeOfWordLibrary

 public override void GetCodeOfWordLibrary(WordLibrary wl)
 {
     if (wl.CodeType == CodeType.Pinyin)
     {
         wl.SetCode(CodeType.UserDefinePhrase,wl.GetPinYinString("", BuildType.None));
     }
     var codes= CollectionHelper.Descartes(wl.Codes);
     wl.SetCode(CodeType.UserDefinePhrase, codes[0]);
 }
開發者ID:XXpanda,項目名稱:imewlconverter,代碼行數:9,代碼來源:PhraseGenerater.cs

示例5: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();

            sb.Append(wl.Word);
            sb.Append("\t");
            if (!wl.IsEnglish)
            {
                sb.Append(wl.GetPinYinString("'", BuildType.RightContain));
                sb.Append("\t");
            }
            sb.Append(wl.Count);
            return sb.ToString();
        }
開發者ID:hahadalin,項目名稱:imewlconverter,代碼行數:14,代碼來源:BaiduPinyin.cs

示例6: ExportLine

 public string ExportLine(WordLibrary wl)
 {
     var sb = new StringBuilder();
     string py = wl.GetPinYinString("'", BuildType.None);
     sb.Append(py);
     sb.Append(" ");
     sb.Append(wl.Word);
     sb.Append(" ");
     sb.Append(number);
     sb.Append(" Z, ");
     sb.Append(py);
     sb.Append(" ");
     sb.Append(number);
     return sb.ToString();
 }
開發者ID:studyzy,項目名稱:imewlconverter,代碼行數:15,代碼來源:QQShouji.cs

示例7: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();

            if (codeGenerater.Is1CharMutiCode)
            {
                IList<string> codes = codeGenerater.GetCodeOfString(wl.Word);
                int i = 0;
                foreach (string code in codes)
                {
                    sb.Append(wl.Word);
                    sb.Append("\t");
                    sb.Append(code);
                    sb.Append("\t");
                    sb.Append(wl.Count);
                    i++;
                    if (i != codes.Count)
                        sb.Append("\r\n");
                }
            }
            else
            {
                sb.Append(wl.Word);
                sb.Append("\t");
                if (CodeType == CodeType.Pinyin)
                {
                    sb.Append(wl.GetPinYinString(" ", BuildType.None));
                }
                else if (CodeType == wl.CodeType)
                {
                    sb.Append(wl.Codes[0][0]);
                }
                else
                {
                    if (codeGenerater.Is1Char1Code)
                    {
                        sb.Append(CollectionHelper.ListToString(codeGenerater.GetCodeOfString(wl.Word), " "));
                    }
                    else
                    {
                        sb.Append(CollectionHelper.ListToString(codeGenerater.GetCodeOfString(wl.Word)));
                    }
                }
                sb.Append("\t");
                sb.Append(wl.Count);
            }
            return sb.ToString();
        }
開發者ID:yongsun,項目名稱:imewlconverter,代碼行數:48,代碼來源:Rime.cs

示例8: ExportLine

        //private RimeConfigForm form;

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();
            if (codeGenerater == null)
            {
                codeGenerater = CodeTypeHelper.GetGenerater(CodeType);
            }
            codeGenerater.GetCodeOfWordLibrary(wl);
            if (codeGenerater.Is1CharMutiCode)
            {
                IList<string> codes = codeGenerater.GetCodeOfString(wl.Word).ToCodeString(" ");
                int i = 0;
                foreach (string code in codes)
                {
                    sb.Append(wl.Word);
                    sb.Append("\t");
                    sb.Append(code);
                    sb.Append("\t");
                    sb.Append(wl.Rank);
                    i++;
                    if (i != codes.Count)
                        sb.Append(lineSplitString);
                }
            }
            else
            {
                sb.Append(wl.Word);
                sb.Append("\t");
                if (CodeType == CodeType.Pinyin || CodeType == CodeType.TerraPinyin)
                {
                    sb.Append(wl.GetPinYinString(" ", BuildType.None));
                }
                else if (CodeType == wl.CodeType)
                {
                    sb.Append(wl.Codes[0][0]);
                }
                else
                {

                    sb.Append(wl.Codes.ToCodeString(" ")[0]);
                }
                sb.Append("\t");
                sb.Append(wl.Rank);
            }
            return sb.ToString();
        }
開發者ID:XXpanda,項目名稱:imewlconverter,代碼行數:48,代碼來源:Rime.cs

示例9: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();

            if (CodeType == CodeType.Pinyin)
            {
                sb.Append(wl.GetPinYinString("", BuildType.None));
            }
            else if (CodeType == wl.CodeType)
            {
                sb.Append(wl.Codes);
            }
            else
            {
                sb.Append(CollectionHelper.ListToString(CodeGenerater.GetCodeOfString(wl.Word)));
            }
            sb.Append(" ");
            sb.Append(wl.Word);
            return sb.ToString();
        }
開發者ID:hahadalin,項目名稱:imewlconverter,代碼行數:20,代碼來源:Xiaoxiao.cs

示例10: ExportLine

  public string ExportLine(WordLibrary wl)
  {
      var sb = new StringBuilder();
      sb.Append(wl.Word);
      sb.Append(" ");
      try
      {
          var py = wl.GetPinYinString("'", BuildType.None);
          if (string.IsNullOrEmpty(py))
          {
              return "";
          }
          sb.Append(py);
      }
      catch (Exception ex)
      {
          Debug.WriteLine(ex.Message);
      }
 
      return sb.ToString();
  }
開發者ID:hahadalin,項目名稱:imewlconverter,代碼行數:21,代碼來源:Libpinyin.cs

示例11: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();

            if (CodeType == CodeType.Pinyin)
            {
                sb.Append(wl.GetPinYinString("", BuildType.None));
            }
            else if (CodeType == wl.CodeType)
            {
                sb.Append(wl.Codes[0][0]);
            }
            else
            {
               var code= CodeGenerater.GetCodeOfString(wl.Word);
                sb.Append(code.ToCodeString());
            }
            sb.Append(" ");
            sb.Append(wl.Word);
            return sb.ToString();
        }
開發者ID:XXpanda,項目名稱:imewlconverter,代碼行數:21,代碼來源:Xiaoxiao.cs

示例12: ExportLine

        public string ExportLine(WordLibrary wl)
        {
            var sb = new StringBuilder();

            sb.Append(wl.Word);
            sb.Append("\t");
            //IList<string> zhuyins = null;
            //if (wl.CodeType == CodeType.Pinyin) //如果本來就是拚音輸入法導入的,那麽就用其拚音,不過得加上音調
            //{
            //    IList<string> pinyin = new List<string>();
            //    for (int i = 0; i < wl.PinYin.Length; i++)
            //    {
            //        if (regex.IsMatch(wl.PinYin[i]))
            //        {
            //            pinyin.Add(wl.PinYin[i]);
            //        }
            //        else
            //        {
            //            pinyin.Add(PinyinHelper.AddToneToPinyin(wl.Word[i], wl.PinYin[i]));
            //        }
            //    }
            //    zhuyins = ZhuyinHelper.GetZhuyin(pinyin);
            //}
            //else
            //{
            //    //zhuyins = generater.GetCodeOfString(wl.Word);
            //}

            //sb.Append(CollectionHelper.ListToString(zhuyins, ","));

            sb.Append(wl.GetPinYinString(",", BuildType.None));
            sb.Append("\t");
            sb.Append("-1.0");
            sb.Append("\t");
            sb.Append("0.0");
            return sb.ToString();
        }
開發者ID:studyzy,項目名稱:imewlconverter,代碼行數:37,代碼來源:YahooKeyKey.cs

示例13: BuildWLString

 //沒有什麽思路,接下來的代碼寫得亂七八糟的,但是好像還是對的。zengyi20101114
 //如果wl中提供了拚音數組,而且自定義格式也是拚音格式,那麽就隻轉換格式即可。
 public string BuildWLString(WordLibrary wl)
 {
     string py = "", cp = "";
     var sb = new StringBuilder();
     if (ContainCode)
     {
         if (IsPinyinFormat)
         {
             py = wl.GetPinYinString(CodeSplitString, CodeSplitType);
         }
         else
         {
             selfFactory.MutiWordCodeFormat = MutiWordCodeFormat;
             py = selfFactory.GetCodeOfString(wl.Word)[0];
         }
     }
     if (ContainRank)
     {
         cp = wl.Count.ToString();
     }
     var dic = new Dictionary<int, string>();
     dic.Add(Sort[0], py);
     dic.Add(Sort[1], wl.Word);
     dic.Add(Sort[2], cp);
     var newSort = new List<int>(Sort);
     newSort.Sort();
     foreach (int x in newSort)
     {
         if (dic[x] != "")
         {
             sb.Append(dic[x] + SplitString);
         }
     }
     string str = sb.ToString();
     return str.Substring(0, str.LastIndexOf(SplitString));
 }
開發者ID:yongsun,項目名稱:imewlconverter,代碼行數:38,代碼來源:ParsePattern.cs


注:本文中的Studyzy.IMEWLConverter.Entities.WordLibrary.GetPinYinString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。