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


C# WordLibraryList.AddWordLibraryList方法代码示例

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


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

示例1: ImportText

        public virtual WordLibraryList ImportText(string str)
        {
            //pinyinFactory = new PinyinGenerater();

            var wlList = new WordLibraryList();
            string[] words = str.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
            CountWord = words.Length;
            CurrentStatus = 0;
            for (int i = 0; i < words.Length; i++)
            {
                try
                {
                    string word = words[i].Trim();
                    if (word != string.Empty)
                    {
                        wlList.AddWordLibraryList(ImportLine(word));
                    }
                }
                catch (Exception ex)
                {
                    Debug.WriteLine(ex.Message);
                }
                CurrentStatus++;
            }
            return wlList;
        }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:26,代码来源:NoPinyinWordOnly.cs

示例2: Import

        public WordLibraryList Import(string path)
        {
            var pyAndWord = new WordLibraryList();
            var fs = new FileStream(path, FileMode.Open, FileAccess.Read);
            fs.Position = 0x44;
            CountWord = BinFileHelper.ReadInt32(fs);
            int segmentCount = BinFileHelper.ReadInt32(fs); //分为几段
            CurrentStatus = 0;
            for (int i = 0; i < segmentCount; i++)
            {
                try
                {
                    fs.Position = 0xC00 + 1024*i;
                    var segment = new Segment(fs);
                    pyAndWord.AddWordLibraryList(segment.WordLibraryList);
                    CurrentStatus += segment.WordLibraryList.Count;
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e.Message);
                }
            }


            return pyAndWord;
        }
开发者ID:hahadalin,项目名称:imewlconverter,代码行数:26,代码来源:ZiGuangPinyinUwl.cs

示例3: ImportText

 public WordLibraryList ImportText(string str)
 {
     var wlList = new WordLibraryList();
     string[] lines = str.Split(new[] {'\r','\n'}, StringSplitOptions.RemoveEmptyEntries);
     CountWord = lines.Length;
     for (int i = 1; i < lines.Length; i++)
     {
         string line = lines[i];
         CurrentStatus = i;
         wlList.AddWordLibraryList(ImportLine(line));
     }
     return wlList;
 }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:13,代码来源:ChinesePyim.cs

示例4: Import

 public WordLibraryList Import(string path)
 {
     var wll = new WordLibraryList();
     string txt = ParseQpyd(path);
     foreach (string line in txt.Split('\n'))
     {
         if (line != "")
         {
             wll.AddWordLibraryList(ImportLine(line));
         }
     }
     return wll;
 }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:13,代码来源:QQPinyinQpyd.cs

示例5: ImportText

 public WordLibraryList ImportText(string str)
 {
     var wlList = new WordLibraryList();
     string[] lines = str.Split(new[] {"\r\n"}, StringSplitOptions.RemoveEmptyEntries);
     CountWord = lines.Length;
     for (int i = 0; i < lines.Length; i++)
     {
         string line = lines[i];
         CurrentStatus = i;
         if (line.IndexOf("'") == 0)
         {
             wlList.AddWordLibraryList(ImportLine(line));
         }
     }
     return wlList;
 }
开发者ID:studyzy,项目名称:imewlconverter,代码行数:16,代码来源:SougouPinyin.cs

示例6: ImportText

        public virtual WordLibraryList ImportText(string str)
        {
            pinyinFactory = new WordPinyinGenerater();

            var wlList = new WordLibraryList();
            string[] words = str.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
            for (int i = 0; i < words.Length; i++)
            {
                try
                {
                    string word = words[i].Trim();
                    if (word != string.Empty)
                    {
                        wlList.AddWordLibraryList(ImportLine(word));
                    }
                }
                catch
                {
                }
            }
            return wlList;
        }
开发者ID:ivlucks,项目名称:imewlconverter,代码行数:22,代码来源:NoPinyinWordOnly.cs

示例7: ImportText

 public WordLibraryList ImportText(string text)
 {
     var list = new WordLibraryList();
     string[] lines = text.Split(new[] {'\n', '\r'}, StringSplitOptions.RemoveEmptyEntries);
     CountWord = lines.Length;
     CurrentStatus = 0;
     foreach (string s in lines)
     {
         CurrentStatus++;
         if (IsContent(s))
         {
             list.AddWordLibraryList(ImportLine(s));
         }
     }
     return list;
 }
开发者ID:yongsun,项目名称:imewlconverter,代码行数:16,代码来源:Xiaoxiao.cs

示例8: ImportText

 public WordLibraryList ImportText(string str)
 {
     var wlList = new WordLibraryList();
     string[] words = str.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);
     CountWord = words.Length;
     for (int i = 0; i < words.Length; i++)
     {
         CurrentStatus = i;
         try
         {
             wlList.AddWordLibraryList(ImportLine(words[i]));
         }
         catch
         {
         }
     }
     return wlList;
 }
开发者ID:yongsun,项目名称:imewlconverter,代码行数:18,代码来源:PinyinJiaJia.cs

示例9: ImportText

 public WordLibraryList ImportText(string str)
 {
     var wlList = new WordLibraryList();
     string[] lines = str.Split(new[] {"\r", "\n"}, StringSplitOptions.RemoveEmptyEntries);
     CountWord = lines.Length;
     for (int i = 0; i < lines.Length; i++)
     {
         string line = lines[i];
         CurrentStatus = i;
         if (line.StartsWith("#"))
         {
             continue;
         }
         wlList.AddWordLibraryList(ImportLine(line));
     }
     return wlList;
 }
开发者ID:XXpanda,项目名称:imewlconverter,代码行数:17,代码来源:Rime.cs


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