本文整理汇总了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);
}
示例2: ExportLine
public string ExportLine(WordLibrary wl)
{
//StringBuilder sb = new StringBuilder();
string str = wl.GetPinYinString("'", BuildType.LeftContain) + " " + wl.Word;
return str;
}
示例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();
}
示例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]);
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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));
}