Refactoring pinyin

1. use custom patched pinyin library Pinyin4Net
2. fix memory leak on startup: 360mb -> 160mb when using vs15 debugger
This commit is contained in:
bao-qian
2016-04-24 00:37:25 +01:00
parent 952b5fab89
commit b600bce23f
16 changed files with 198 additions and 691 deletions

View File

@@ -9,24 +9,7 @@ namespace Wox.Plugin.Program
public class Program
{
private static readonly Regex AbbrRegexp = new Regex("[^A-Z0-9]", RegexOptions.Compiled);
private string m_Title;
public string Title
{
get
{
return m_Title;
}
set
{
m_Title = value;
string pinyin = m_Title.Unidecode();
PinyinTitle = pinyin;
AbbrTitle = AbbrRegexp.Replace(Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(pinyin), "");
if (AbbrTitle.Length < 2) AbbrTitle = null;
}
}
public string PinyinTitle { get; private set; }
public string AbbrTitle { get; private set; }
public string Title { get; set; }
public string IcoPath { get; set; }
public string ExecutePath { get; set; }
public string ExecuteName { get; set; }