本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}