当前位置: 首页>>代码示例>>C#>>正文


C# WordLibraryList.Add方法代码示例

本文整理汇总了C#中WordLibraryList.Add方法的典型用法代码示例。如果您正苦于以下问题:C# WordLibraryList.Add方法的具体用法?C# WordLibraryList.Add怎么用?C# WordLibraryList.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WordLibraryList的用法示例。


在下文中一共展示了WordLibraryList.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     var wlList = new WordLibraryList();
     WordLibrary wl = UserDefiningPattern.BuildWordLibrary(line);
     wlList.Add(wl);
     return wlList;
 }
开发者ID:ivlucks,项目名称:imewlconverter,代码行数:7,代码来源:SelfDefining.cs

示例2: ImportLine

        public virtual WordLibraryList ImportLine(string line)
        {
            var wlList = new WordLibraryList();
            string[] strs = line.Split(' ');

            for (int i = 1; i < strs.Length; i++)
            {
                var oriWord = strs[i];
                string word = oriWord.Replace(",", ""); //把汉字中带有逗号的都去掉逗号
                //var list = pinyinFactory.GetCodeOfString(word);
                //for (int j = 0; j < list.Count; j++)
                //{
                var wl = new WordLibrary();
                wl.Word = oriWord;
                //if (IsWubi)
                //{
                //    wl.SetCode(CodeType.Wubi, strs[0]);
                //}
                //wl.PinYin = CollectionHelper.ToArray(list);
                wl.SetCode(this.CodeType,strs[0]);
                wlList.Add(wl);
                //}
            }
            return wlList;
        }
开发者ID:hahadalin,项目名称:imewlconverter,代码行数:25,代码来源:Jidian.cs

示例3: ImportLine

 /// <summary>
 /// 将一行纯文本转换为对象
 /// </summary>
 /// <param name="line"></param>
 /// <returns></returns>
 public virtual WordLibraryList ImportLine(string line)
 {
     var py = pinyinFactory.GetCodeOfString(line);
     var wl = new WordLibrary();
     wl.Word = line;
     wl.PinYin = ToArray(py);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:ivlucks,项目名称:imewlconverter,代码行数:15,代码来源:NoPinyinWordOnly.cs

示例4: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     string[] c = line.Split('\t');
     var wl = new WordLibrary();
     wl.Word = c[0];
     wl.Rank = Convert.ToInt32(c[2]);
     wl.PinYin = c[1].Split(new[] { '\'' }, StringSplitOptions.RemoveEmptyEntries);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:studyzy,项目名称:imewlconverter,代码行数:11,代码来源:ShouxinPinyin.cs

示例5: ImportLine

 /// <summary>
 ///     将一行纯文本转换为对象
 /// </summary>
 /// <param name="line"></param>
 /// <returns></returns>
 public virtual WordLibraryList ImportLine(string line)
 {
     //IList<string> py = pinyinFactory.GetCodeOfString(line);
     var wl = new WordLibrary();
     wl.Word = line;
     wl.CodeType = CodeType;
     //wl.PinYin = CollectionHelper.ToArray(py);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:studyzy,项目名称:imewlconverter,代码行数:16,代码来源:NoPinyinWordOnly.cs

示例6: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     string py = line.Split(' ')[0];
     string word = line.Split(' ')[1];
     var wl = new WordLibrary();
     wl.Word = word;
     wl.Rank = 1;
     wl.PinYin = py.Split(new[] {'\''}, StringSplitOptions.RemoveEmptyEntries);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:studyzy,项目名称:imewlconverter,代码行数:12,代码来源:SinaPinyin.cs

示例7: ImportLine

        public WordLibraryList ImportLine(string line)
        {
            string[] wp = line.Split('\t');

            string word = wp[0];
            var wl = new WordLibrary();
            wl.Word = word;
            wl.Count = Convert.ToInt32(wp[1]);
            wl.PinYin = new string[] {};
            var wll = new WordLibraryList();
            wll.Add(wl);
            return wll;
        }
开发者ID:yongsun,项目名称:imewlconverter,代码行数:13,代码来源:BaiduShoujiEng.cs

示例8: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     string[] c = line.Split(' ');
     var wl = new WordLibrary();
     string code = c[0];
     wl.Word = c[1];
     wl.Count = DefaultRank;
     wl.PinYin = CollectionHelper.ToArray(pyGenerater.GetCodeOfString(wl.Word));
     wl.AddCode(CodeType, code);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:yongsun,项目名称:imewlconverter,代码行数:13,代码来源:CangjiePlatform.cs

示例9: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     string[] lineArray = line.Split('\t');
     string py = lineArray[1];
     string word = lineArray[0];
     var wl = new WordLibrary();
     wl.Word = word;
     wl.Count = Convert.ToInt32(lineArray[2]);
     wl.PinYin = py.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:ivlucks,项目名称:imewlconverter,代码行数:13,代码来源:Rime.cs

示例10: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     string[] c = line.Split(' ');
     var wl = new WordLibrary();
     string code = c[0];
     wl.Word = c[1];
     wl.Rank = DefaultRank;
     wl.SetCode(CodeType.Cangjie, pyGenerater.GetCodeOfString(wl.Word));
     wl.SetCode(CodeType, code);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:studyzy,项目名称:imewlconverter,代码行数:13,代码来源:CangjiePlatform.cs

示例11: ImportLine

        public WordLibraryList ImportLine(string line)
        {
            string[] sp = line.Split(' ');
            string py = sp[1];
            string word = sp[0];

            var wl = new WordLibrary {CodeType = CodeType.Pinyin};
            wl.Word = word;
            wl.Rank = DefaultRank;
            wl.PinYin = py.Split(new[] {'\''}, StringSplitOptions.RemoveEmptyEntries);
            var wll = new WordLibraryList();
            wll.Add(wl);
            return wll;
        }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:14,代码来源:Libpinyin.cs

示例12: ImportLine

        public WordLibraryList ImportLine(string line)
        {
            string[] sp = line.Split(',');

            string word = sp[0];
            int count = Convert.ToInt32(sp[1]);
            var wl = new WordLibrary();
            wl.Word = word;
            wl.Rank = count;
            wl.PinYin = new string[] {};
            var wll = new WordLibraryList();
            wll.Add(wl);
            return wll;
        }
开发者ID:studyzy,项目名称:imewlconverter,代码行数:14,代码来源:QQPinyinEng.cs

示例13: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     line = line.Split(',')[0]; //如果有逗号,就只取第一个
     string[] sp = line.Split(' ');
     string py = sp[0];
     string word = sp[1];
     int count = Convert.ToInt32(sp[2]);
     var wl = new WordLibrary();
     wl.Word = word;
     wl.Rank = count;
     wl.PinYin = py.Split(new[] {'\''}, StringSplitOptions.RemoveEmptyEntries);
     var wll = new WordLibraryList();
     wll.Add(wl);
     return wll;
 }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:15,代码来源:QQPinyin.cs

示例14: Filter

 public WordLibraryList Filter(WordLibraryList list)
 {
     if (Percentage == 100)
     {
         return list;
     }
     int count = list.Count*Percentage/100;
     list.Sort((a, b) => a.Rank - b.Rank);
     var result = new WordLibraryList();
     for (int i = 0; i < count; i++)
     {
         result.Add(list[i]);
     }
     return result;
 }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:15,代码来源:RankPercentageFilter.cs

示例15: ImportLine

 public WordLibraryList ImportLine(string line)
 {
     string code = line.Split(' ')[0];
     string word = line.Split(' ')[1];
     var wl = new WordLibrary();
     wl.Word = word;
     wl.Count = DefaultRank;
     wl.PinYin = ToArray(pinyinFactory.GetCodeOfString(word));
     var wll = new WordLibraryList();
     if (wl.PinYin.Length > 0)
     {
         wll.Add(wl);
     }
     return wll;
 }
开发者ID:ivlucks,项目名称:imewlconverter,代码行数:15,代码来源:Wubi98.cs


注:本文中的WordLibraryList.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。