public BingTrans getSentenceTransResult(string Sentence) { Sentence = Sentence.Trim(); BingTrans Result = null; if ((Result = BingTransApi.getDataBaseTransResult(Sentence)) != null) { Console.WriteLine($"DataBase : {Sentence} -> {string.Join(" ", Result.defs)}"); return(Result); } else { Result = SentenceTrans(Sentence, "en", "zh-CN"); BingTransApi.TransResultToDataBase(Result); Console.WriteLine($"web : {Sentence} -> {string.Join(" ", Result.defs)}"); return(Result); } }
public BingTrans getTransResult(string Word) { Word = Word.Trim(); BingTrans Result = null; if ((Result = BingTransApi.getDataBaseTransResult(Word)) != null) { Console.WriteLine($"DataBase : {Word} -> {string.Join(" ", Result.defs)}"); return(Result); } else { Result = Trans(Word, "en", "zh-CN"); BingTransApi.TransResultToDataBase(Result); Console.WriteLine($"web : {Word} -> {string.Join(" ", Result.defs)}"); return(Result); } }