Skip to content

Commit

Permalink
Fix a sougo pinyin convert to win10 ms pinyin generate code bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
studyzy committed Oct 16, 2018
1 parent 6960a8a commit b917f6c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions IME WL Converter/IME WL Converter/IME/Win10MsPinyin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Studyzy.IMEWLConverter.Entities;
using Studyzy.IMEWLConverter.Helpers;

Expand Down Expand Up @@ -154,9 +153,9 @@ public WordLibraryList ImportLine(string str)

public IList<string> Export(WordLibraryList wlList)
{
//Win10拼音只支持最多32个字符的编码
//Win10拼音只支持最多32个字符的编码
wlList = Filter(wlList);
string tempPath = Path.GetDirectoryName(Application.ExecutablePath) + "\\Win10_1703微软拼音词库.dat";
string tempPath = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + "\\Win10微软拼音词库.dat";
if (File.Exists(tempPath)) { File.Delete(tempPath); }
var fs = new FileStream(tempPath, FileMode.OpenOrCreate, FileAccess.Write);
BinaryWriter bw = new BinaryWriter(fs);
Expand Down
4 changes: 4 additions & 0 deletions IME WL Converter/IME WL Converter/MainBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ private void GenerateWordRank(WordLibraryList wordLibraryList)

private void GenerateDestinationCode(WordLibraryList wordLibraryList, CodeType codeType)
{
if(wordLibraryList[0].CodeType== CodeType.NoCode&& codeType == CodeType.UserDefinePhrase)
{
codeType = CodeType.Pinyin;
}
IWordCodeGenerater generater = CodeTypeHelper.GetGenerater(codeType);
if (generater == null) //未知编码方式,则不进行编码。
return;
Expand Down

0 comments on commit b917f6c

Please sign in to comment.