修改 主程序下的Comm文件夹 转到 Frameork中
This commit is contained in:
1 parent
2f9c98b105
commit
1eb5315261
78 files changed
+274
-227
No files matched your search
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace WxOrder.Framework.Commons.pinyin
|
||||
{
|
||||
public abstract class PinyinDict : IPinyinDict
|
||||
{
|
||||
public abstract Dictionary<string, string[]> Mapping();
|
||||
|
||||
public string[] ToPinyin(string word)
|
||||
{
|
||||
var mappingResult = Mapping();
|
||||
if (mappingResult == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if (mappingResult.TryGetValue(word, out var result))
|
||||
{
|
||||
return result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<string> Words()
|
||||
{
|
||||
var mappingResult = Mapping();
|
||||
if (mappingResult == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return mappingResult.Keys.Select(key => key).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user