diff --git a/src/IME WL Converter Win/CoreWinFormMapping.cs b/src/IME WL Converter Win/CoreWinFormMapping.cs index 9d18a844..ca73e589 100644 --- a/src/IME WL Converter Win/CoreWinFormMapping.cs +++ b/src/IME WL Converter Win/CoreWinFormMapping.cs @@ -22,41 +22,42 @@ private void InitImportFormMapping() imeFormMapping.Add(typeof (UserDefinePhrase), new PhraseFormatConfigForm()); imeFormMapping.Add(typeof (XiaoxiaoErbi), new ErbiTypeForm()); imeFormMapping.Add(typeof(Win10MsPinyin), new PinyinConfigForm()); + imeFormMapping.Add(typeof(Gboard), new PinyinConfigForm()); } private void InitImportPropertityMapping() { formPropertityMapping = new Dictionary>(); - formPropertityMapping.Add(typeof (RimeConfigForm), + formPropertityMapping.Add(typeof(RimeConfigForm), new Dictionary { {"SelectedCodeType", "CodeType"}, {"SelectedOS", "OS"} }); - formPropertityMapping.Add(typeof (Ld2EncodingConfigForm), + formPropertityMapping.Add(typeof(Ld2EncodingConfigForm), new Dictionary { {"SelectedEncoding", "WordEncoding"} }); - formPropertityMapping.Add(typeof (XiaoxiaoConfigForm), + formPropertityMapping.Add(typeof(XiaoxiaoConfigForm), new Dictionary { {"SelectedCodeType", "CodeType"} }); - formPropertityMapping.Add(typeof (SelfDefiningConfigForm), + formPropertityMapping.Add(typeof(SelfDefiningConfigForm), new Dictionary { {"SelectedParsePattern", "UserDefiningPattern"} }); - formPropertityMapping.Add(typeof (PhraseFormatConfigForm), + formPropertityMapping.Add(typeof(PhraseFormatConfigForm), new Dictionary { {"PhraseFormat", "PhraseFormat"}, {"SelectedCodeType", "CodeType"}, { "IsShortCode","IsShortCode"} }); - formPropertityMapping.Add(typeof (ErbiTypeForm), + formPropertityMapping.Add(typeof(ErbiTypeForm), new Dictionary { {"SelectedCodeType", "CodeType"} diff --git a/src/IME WL Converter Win/Properties/AssemblyInfo.cs b/src/IME WL Converter Win/Properties/AssemblyInfo.cs index 1dd34167..f82c40b3 100644 --- a/src/IME WL Converter Win/Properties/AssemblyInfo.cs +++ b/src/IME WL Converter Win/Properties/AssemblyInfo.cs @@ -38,5 +38,5 @@ // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.9.0.0")] -[assembly: AssemblyFileVersion("2.9.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.9.1.0")] +[assembly: AssemblyFileVersion("2.9.1.0")] \ No newline at end of file diff --git a/src/ImeWlConverterCore/IME/Gboard.cs b/src/ImeWlConverterCore/IME/Gboard.cs index dbc58696..34637096 100644 --- a/src/ImeWlConverterCore/IME/Gboard.cs +++ b/src/ImeWlConverterCore/IME/Gboard.cs @@ -3,6 +3,7 @@ using System.IO; using System.Text; using Studyzy.IMEWLConverter.Entities; +using Studyzy.IMEWLConverter.Filters; using Studyzy.IMEWLConverter.Helpers; namespace Studyzy.IMEWLConverter.IME @@ -13,8 +14,41 @@ namespace Studyzy.IMEWLConverter.IME [ComboBoxShow(ConstantString.GBOARD, ConstantString.GBOARD_C, 111)] public class Gboard : BaseImport, IWordLibraryExport, IWordLibraryImport { + public Gboard() + { + this.PinyinType = PinyinType.FullPinyin; + } #region IWordLibraryExport 成员 + public PinyinType PinyinType + { + get; set; + } + private WordLibraryList Filter(WordLibraryList wlList) + { + var result = new WordLibraryList(); + IReplaceFilter replace = null; + if (PinyinType != PinyinType.FullPinyin) + { + replace = new ShuangpinReplacer(PinyinType); + } + foreach (var wl in wlList) + { + if (replace != null) + { + replace.Replace(wl); + } + + //if (wl.GetPinYinLength() > 32) + // continue; + //if (wl.Word.Length > 64) + // continue; + + result.Add(wl); + + } + return result; + } public string ExportLine(WordLibrary wl) { var sb = new StringBuilder(); @@ -28,6 +62,8 @@ public string ExportLine(WordLibrary wl) public IList Export(WordLibraryList wlList) { + //对全拼方案进行编码转换 + wlList = Filter(wlList); string tempPath = Path.Combine(FileOperationHelper.GetCurrentFolderPath(), "dictionary.txt"); if (File.Exists(tempPath)) { File.Delete(tempPath); } var sb = new StringBuilder(); diff --git a/src/ImeWlConverterCore/IME/Win10MsPinyin.cs b/src/ImeWlConverterCore/IME/Win10MsPinyin.cs index e33873c0..0c0a0aef 100644 --- a/src/ImeWlConverterCore/IME/Win10MsPinyin.cs +++ b/src/ImeWlConverterCore/IME/Win10MsPinyin.cs @@ -161,6 +161,7 @@ private WordLibrary ReadOnePhrase(FileStream fs, int nextStartPosition) catch { wl.CodeType = CodeType.NoCode; + ImportLineErrorNotice?.Invoke(wl.Word+" 的编码缺失"); } return wl; diff --git a/src/ImeWlConverterCore/ImeWlConverterCore-net46.csproj b/src/ImeWlConverterCore/ImeWlConverterCore-net46.csproj index 1c5dd657..f6f8f186 100644 --- a/src/ImeWlConverterCore/ImeWlConverterCore-net46.csproj +++ b/src/ImeWlConverterCore/ImeWlConverterCore-net46.csproj @@ -5,7 +5,7 @@ net46 ImeWlConverterCore ImeWlConverterCore - 2.9.0 + 2.9.1