diff --git a/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs b/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs new file mode 100644 index 0000000..5b18b5a --- /dev/null +++ b/src/AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using WpfApp1.WinOcr; +using WpfApp1.ScnToJson; +using WpfApp1.translationKey; + +namespace testRjgc +{ + internal class AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction + { + AllClassAndInterfaceWellBeManipulatedInThisFileAndCallThroughFunction() { } + + public void InputPrivate(string name, string id, string key) + { + TranslationPrivateIn tr = new TranslationPrivateIn(); + tr.InputTranslationPrivate(name, id, key); + } + + public List OutputNameList(string id) + { + TranslationApiStr tr = new translationPrivateOut(); + List list = tr.OutputTranslationNameList(); + return list; + } + + public List OutputStr(string id) + { + TranslationApiStr str = new translationPrivateOut(); + List li = str.OutputTranslationS(id); + return li; + } + + public List OutputPub(int id) + { + TranslationApiInt sin = new translationPublic(); + List li = sin.OutputTranslationI(id); + return li; + } + + public void StartSCNTransJSON() + { + TranslationScnToJson scn = new TranslationScnToJson(); + scn.StartTrans(); + } + + public void StartTransOneself(string spa, string dps) + { + TranslationScnToJson scn = new TranslationScnToJson(); + scn.StopTrans(spa, dps); + } + + public string WindowsOcrToGetString(string name) + { + Sofia so = new OcrSofia(); + string temp = so.WindowsOcrToGetStringAndTranslate(name); + return temp; + } + + } +} diff --git a/src/WinOcr/OcrSofia.cs b/src/WinOcr/OcrSofia.cs index eaf14d1..0215070 100644 --- a/src/WinOcr/OcrSofia.cs +++ b/src/WinOcr/OcrSofia.cs @@ -4,9 +4,9 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Runtime.InteropServices; -using System.Windows.Forms; +//using System.Windows.Forms; -namespace testRjgc.WinOcr +namespace WpfApp1.WinOcr { internal class OcrSofia : Sofia { @@ -20,12 +20,13 @@ namespace testRjgc.WinOcr this.DirExists(); Image image = null; - + /* MODI.Document modiDocument = new MODI.Document(); modiDocument.Create(path + "\\" + name + ".jpg"); modiDocument.OCR(MODI.MiLANGUAGES.miLANG_CHINESE_SIMPLIFIED, true, true); MODI.Image modiImage = (MODI.Image)modiDocument.Images[0]; retxt = modiImage.Layout.Text; + */ return retxt; } diff --git a/src/WinOcr/Sofia.cs b/src/WinOcr/Sofia.cs index cd40e93..9e3b73e 100644 --- a/src/WinOcr/Sofia.cs +++ b/src/WinOcr/Sofia.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace testRjgc.WinOcr +namespace WpfApp1.WinOcr { internal interface Sofia { diff --git a/src/translationKey/translationPrivateIn.cs b/src/translationKey/translationPrivateIn.cs index 9935304..8398ec3 100644 --- a/src/translationKey/translationPrivateIn.cs +++ b/src/translationKey/translationPrivateIn.cs @@ -15,7 +15,7 @@ namespace WpfApp1.translationKey public TranslationPrivateIn() { } - public void InputTranslationPrivate(string name, string id, string key) + public void InputTranslationPrivate(string name, string id, string key)//目前仅百度支持 { if(Directory.Exists(pathTemp)) { diff --git a/src/translationKey/translationPrivateOut.cs b/src/translationKey/translationPrivateOut.cs index bc38ca6..c0e1154 100644 --- a/src/translationKey/translationPrivateOut.cs +++ b/src/translationKey/translationPrivateOut.cs @@ -60,7 +60,7 @@ namespace WpfApp1.translationKey if (Directory.Exists(temppath))//诺不存在 { - temp.Add("ERROR"); + temp.Add("尚未输入!!!"); return temp; } diff --git a/src/translationKey/translationPublic.cs b/src/translationKey/translationPublic.cs index 0a17196..64122fd 100644 --- a/src/translationKey/translationPublic.cs +++ b/src/translationKey/translationPublic.cs @@ -27,10 +27,16 @@ namespace WpfApp1.translationKey temp.Add("yjvMNY33Qc1TYSBjTQYQ");//APIKey break; } - case 2://google + case 2://百度2 { - temp.Add("");//NULL,空 - temp.Add("");//APIKey + temp.Add("20230925001829663"); + temp.Add("f7ZHpw28izQ1VU_ixoY5"); + break; + } + case 3://google + { + temp.Add("UNSET!");//NULL,空 + temp.Add("UNSET!");//APIKey break; } }