Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
studyzy committed Aug 7, 2015
1 parent 65628e6 commit 8996a95
Show file tree
Hide file tree
Showing 16 changed files with 48 additions and 39 deletions.
2 changes: 1 addition & 1 deletion IME WL Converter/IME WL Converter/Entities/WordLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public string WubiCode
{
get
{
if (CodeType == CodeType.Wubi)
if (CodeType == CodeType.Wubi||CodeType==CodeType.Wubi98)
{
return Codes[0][0];
}
Expand Down
2 changes: 1 addition & 1 deletion IME WL Converter/IME WL Converter/Forms/HelpForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private void HelpForm_Load(object sender, EventArgs e)
helpString +=
"2.0版增加了简繁体转换功能、支持多种五笔、郑码、仓颉、注音、二笔等输入法词库、百度拼音PC版、灵格斯ld2格式等,增加对仓颉平台、雅虎奇摩输入法的支持。加强了Rime输入法和小小输入法\r\n";
helpString += "2.1版修复了自定义转换时的Bug,增加了超音速录、手心输入法等的支持。升级为.Net 3.5只要在Vista以上操作系统不需要安装.Net。";
helpString += "关于各种输入法的词库转换操作方法可以参见项目网站(http://code.google.com/p/imewlconverter/)\r\n";
helpString += "关于各种输入法的词库转换操作方法可以参见项目网站(https://github.com/studyzy/imewlconverter/)\r\n";
helpString +=
"如果您觉得深蓝词库转换能够给您的生活带来了极大的方便,可以通过Paypal或者支付宝捐赠该软件(https://github.com/studyzy/imewlconverter/wiki/Donate)。\r\n";
helpString += "有任何问题和建议请联系我:studyzy@163.com\r\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ public virtual void GetCodeOfWordLibrary(WordLibrary wl)
}

public abstract Code GetCodeOfString(string str);

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Studyzy.IMEWLConverter.Generaters
using Studyzy.IMEWLConverter.Entities;

namespace Studyzy.IMEWLConverter.Generaters
{
public class ChaoqiangErbiGenerater : ErbiGenerater
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ namespace Studyzy.IMEWLConverter.Generaters

public abstract class ErbiGenerater :BaseCodeGenerater, IWordCodeGenerater
{

/// <summary>
/// 二笔的编码可能是一字多码的
/// </summary>
Expand Down
11 changes: 6 additions & 5 deletions IME WL Converter/IME WL Converter/Generaters/PhraseGenerater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ public bool Is1CharMutiCode
}


public IList<string> GetCodeOfWordLibrary(WordLibrary str, string charCodeSplit = "")

public override void GetCodeOfWordLibrary(WordLibrary wl)
{
if (str.CodeType == CodeType.Pinyin)
if (wl.CodeType == CodeType.Pinyin)
{
return new List<string> {str.GetPinYinString("", BuildType.None)};
wl.SetCode(CodeType.UserDefinePhrase,wl.GetPinYinString("", BuildType.None));
}
return CollectionHelper.Descartes(str.Codes);
var codes= CollectionHelper.Descartes(wl.Codes);
wl.SetCode(CodeType.UserDefinePhrase, codes[0]);
}

public override Code GetCodeOfString(string str)
{
throw new NotImplementedException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public bool Is1Char1Code
#endregion


public void GetCodeOfWordLibrary(WordLibrary wl)
public virtual void GetCodeOfWordLibrary(WordLibrary wl)
{
wl.Codes = GetCodeOfString(wl.Word);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Studyzy.IMEWLConverter.Entities;
using Studyzy.IMEWLConverter.Helpers;

namespace Studyzy.IMEWLConverter.Generaters
Expand All @@ -10,7 +11,6 @@ public override string GetDefaultCodeOfChar(char str)
return DictionaryHelper.GetCode(str).Wubi98;
}


public override IList<string> GetAllCodesOfChar(char str)
{
return new List<string> {DictionaryHelper.GetCode(str).Wubi98};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@ private string Get1Code(char c)
{
return ZhengmaDic[c].ShortCode[0].ToString();
}

}
}
8 changes: 8 additions & 0 deletions IME WL Converter/IME WL Converter/Helpers/CodeTypeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public static IWordCodeGenerater GetGenerater(CodeType codeType)
return new PinyinGenerater();
case CodeType.Wubi:
return new Wubi86Generater();
case CodeType.Wubi98:
return new Wubi98Generater();
case CodeType.QingsongErbi:
return new QingsongErbiGenerater();
case CodeType.ChaoqiangErbi:
Expand All @@ -56,6 +58,12 @@ public static IWordCodeGenerater GetGenerater(CodeType codeType)
return new Cangjie5Generater();
case CodeType.Chaoyin:
return new ChaoyinGenerater();
case CodeType.UserDefinePhrase:
return new PhraseGenerater();
case CodeType.Zhuyin:
return new ZhuyinGenerater();
case CodeType.NoCode:
return null;
//case CodeType.UserDefine:
// {
// return SelfDefiningCodeGenerater();
Expand Down
31 changes: 16 additions & 15 deletions IME WL Converter/IME WL Converter/IME/Jidian.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
namespace Studyzy.IMEWLConverter.IME
{
/// <summary>
/// 极点的词库格式为“编码 词语 词语 词语”\r\n
/// 极点五笔/郑码的词库格式为“编码 词语 词语 词语”\r\n
/// </summary>
[ComboBoxShow(ConstantString.JIDIAN, ConstantString.JIDIAN_C, 190)]
public class Jidian : BaseImport, IWordLibraryTextImport, IWordLibraryExport
{
protected virtual bool IsWubi
{
get { return false; }
}
//protected virtual bool IsWubi
//{
// get { return true; }
//}

public override CodeType CodeType
{
get { return CodeType.Unknown; }
get { return CodeType.Wubi; }
}

#region IWordLibraryImport 成员
Expand Down Expand Up @@ -76,19 +76,20 @@ public virtual WordLibraryList ImportLine(string line)

#region IWordLibraryExport 成员

private readonly IWordCodeGenerater wubiFactory = new Wubi86Generater();


public virtual string ExportLine(WordLibrary wl)
{
var sb = new StringBuilder();
if (string.IsNullOrEmpty(wl.WubiCode))
{
sb.Append(wubiFactory.GetCodeOfString(wl.Word)[0]);
}
else
{
sb.Append(wl.WubiCode);
}
//if (string.IsNullOrEmpty(wl.WubiCode))
//{
// sb.Append(wubiFactory.GetCodeOfString(wl.Word)[0]);
//}
//else
//{
// sb.Append(wl.WubiCode);
//}
sb.Append(wl.SingleCode);
sb.Append(" ");
sb.Append(wl.Word);

Expand Down
5 changes: 1 addition & 4 deletions IME WL Converter/IME WL Converter/IME/QQWubi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ namespace Studyzy.IMEWLConverter.IME
[ComboBoxShow(ConstantString.QQ_WUBI, ConstantString.QQ_WUBI_C, 70)]
public class QQWubi : Jidian
{
protected override bool IsWubi
{
get { return true; }
}


public override CodeType CodeType
{
Expand Down
2 changes: 1 addition & 1 deletion IME WL Converter/IME WL Converter/IME/UserDefinePhrase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public UserDefinePhrase()

public override CodeType CodeType
{
get { return CodeType.Unknown; }
get { return CodeType.UserDefinePhrase; }
}


Expand Down
5 changes: 1 addition & 4 deletions IME WL Converter/IME WL Converter/IME/XiaoyaWubi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ namespace Studyzy.IMEWLConverter.IME
[ComboBoxShow(ConstantString.XIAOYA_WUBI, ConstantString.XIAOYA_WUBI_C, 191)]
public class XiaoyaWubi : Jidian
{
protected override bool IsWubi
{
get { return true; }
}


public override CodeType CodeType
{
Expand Down
3 changes: 2 additions & 1 deletion IME WL Converter/IME WL Converter/MainBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ private void GenerateDestinationCode(WordLibraryList wordLibraryList, CodeType c
continue;
}
generater.GetCodeOfWordLibrary(wordLibrary);

if(codeType!=CodeType.Unknown)
wordLibrary.CodeType = codeType;
}
}

Expand Down
7 changes: 3 additions & 4 deletions IME WL Converter/IME WL Converter/Readme.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ע�⣺��С���߻���C#���������Ե����ϱ��밲װ.Net Framework 4.0�����������У����˫���������ʿ�ת��.exe���󵯳����󴰿ڣ������ذ�װ.Net Framework 4.0���ԡ�
ע�⣺��С���߻���C#���������Ե����ϱ���Vista����ϵͳ���߰�װ.Net Framework 3.5��XP�����������У����˫���������ʿ�ת��.exe���󵯳����󴰿ڣ������ذ�װ.Net Framework 4.0���ԡ�


1.1��֧���ѹ���ϸ���ʿ⣨scel��ʽ����ת���������Ե��ѹ���վ����ϸ���ʿ⵼�뵽���������뷨�����ֻ����뷨�У�
Expand All @@ -13,12 +13,11 @@ QQ
1.8���������Զ��������������ǿ�������й��ܣ���ʹ��-?�鿴�����а�����ʵ���˰ٶ��ֻ�����ʿ⣨bcd��ʽ����СС���뷨��΢��ƴ�����뷨�Ĵʿ⹦�ܣ����ǿ����������뷨��ԭ�򣬻ᵼ��ʧ�ܡ�
1.9��������΢��Ӣ��ƴ�����뷨��FIT���뷨���ѹ�Bin��ʽ���ݴʿ⡢�����ϣ�С�Ǻ�������ܣ������ֳ���������뷨��֧�֣����Ӵʿ��ļ��ָ�ܡ�
2.0��֧�ֶ��ֱ����Rime���뷨��֧�ֶ��ֱ����СС���뷨�������˶����˹ld2�ʵ��ʽ��֧�ֺ�Ӣ��ʿ�֧�֣������˼���ת�����ܣ������˶��Ż���Ħ���뷨�����ƽ̨��֧�֣���ǿ�˶Ը���ʺ�֣�����뷨��֧�֣�ͬʱ�Ż����ڲ����룬��ǿ�Զ������Ĺ��ܡ�
2.1������Ϊ.net 4.0���ṩ��Mac��Linux��Mono�����е��á��޸���֮ǰ�Զ��嵼����Bug�������˶Ը������뷨���û��Զ������ĵ��뵼��֧�֣�����������ת��ʱ���뵼���ļ�һ��һ��֧�֣������Ǻϲ��ʿ��һ���ļ��������˴ʿ�ϲ����ܡ��������ļ��ָ��Bug�ʹʿ�ת��ʱ��һЩBug��
2.1������Ϊ.net 3.5���޸���֮ǰ�Զ��嵼����Bug�������˶Ը������뷨���û��Զ������ĵ��뵼��֧�֣����ӶԳ�����д���������뷨��֧�֣�����������ת��ʱ���뵼���ļ�һ��һ��֧�֣������Ǻϲ��ʿ��һ���ļ��������˴ʿ�ϲ����ܡ��������ļ��ָ��Bug�ʹʿ�ת��ʱ��һЩBug��

ע�⣺Ŀǰ�޷���7.2�Ժ�汾���ѹ����뷨���ݴʿ���н����������Ҫ�����ѹ����뷨���û��ʿ⣬��Ҫ��װ�ѹ����뷨7.1�棬Ȼ�󱸷�bin��ʽ�ʿ⣬�ٽ���ת����

������и���Ĵʿ���Ҫת�������߶Ըôʿ�ת��������ʲô���飬����ϵ�ң�studyzy@163.com
�ҵIJ��ͣ�http://studyzy.cnblogs.com
����΢����http://weibo.com/studyzy
�����ʿ�ת����΢����http://weibo.com/imewlconverter

--����

0 comments on commit 8996a95

Please sign in to comment.