public static WordsStorageModel GetWordModelFromAiCiBa(AiCiBaE2C_Model _aimodel) { WordsStorageModel result = new WordsStorageModel(); result.Word = _aimodel.word_name; result.word_pl = ListHelper.GetListFromArray(_aimodel.exchange.word_pl); result.word_past = ListHelper.GetListFromArray(_aimodel.exchange.word_past); result.word_done = ListHelper.GetListFromArray(_aimodel.exchange.word_done); result.word_ing = ListHelper.GetListFromArray(_aimodel.exchange.word_ing); result.word_third = ListHelper.GetListFromArray(_aimodel.exchange.word_third); result.word_er = ListHelper.GetListFromArray(_aimodel.exchange.word_er); result.word_est = ListHelper.GetListFromArray(_aimodel.exchange.word_est); result.ph_en = _aimodel.symbols[0].ph_en; result.ph_am = _aimodel.symbols[0].ph_am; result.ph_other = _aimodel.symbols[0].ph_other; result.ph_en_mp3 = _aimodel.symbols[0].ph_en_mp3; result.ph_am_mp3 = _aimodel.symbols[0].ph_am_mp3; result.ph_tts_mp3 = _aimodel.symbols[0].ph_tts_mp3; foreach (var definition in _aimodel.symbols[0].parts.ToList()) { result.Definitions.Add(new DefinitionStroage() { part = definition.part, means = definition.means.ToList() }); } return(result); }
public static WordModel GetWordModelFromAiCiBaE2C(AiCiBaE2C_Model _aimodel) { WordModel result = new WordModel(); result.Word = _aimodel.word_name; result.Pronounciations.Add(new Pronounciation() { PronounciationType = "英", PhoneticSymbol = _aimodel.symbols[0].ph_en, SoundUri = _aimodel.symbols[0].ph_en_mp3 }); result.Pronounciations.Add(new Pronounciation() { PronounciationType = "美", PhoneticSymbol = _aimodel.symbols[0].ph_am, SoundUri = _aimodel.symbols[0].ph_am_mp3 }); result.Pronounciations.Add(new Pronounciation() { PronounciationType = "其他", PhoneticSymbol = _aimodel.symbols[0].ph_other, SoundUri = _aimodel.symbols[0].ph_tts_mp3 }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "复数", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_pl) }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "过去式", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_past) }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "过去分词", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_done) }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "进行时", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_ing) }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "第三人称", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_third) }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "比较级", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_er) }); result.InflectionWords.Add(new InflectionWord() { InflectionType = "最高级", Words = ListHelper.GetListFromArray(_aimodel.exchange.word_est) }); foreach (var definition in _aimodel.symbols[0].parts.ToList()) { result.Definitions.Add(new Definition() { PartOfSpeech = definition.part, Meanings = definition.means.ToList() }); } return(result); }
public static WordsStorageModel Add(AiCiBaE2C_Model model) { return(Add(GetWordModelFromAiCiBa(model))); }