Add AME_PHON and BRE_PHON fields to oxford_learning dictionary export.

This commit is contained in:
Javan Zhu 2019-01-20 09:34:04 +08:00
parent 7dc4953db2
commit 9c4771fdf9

View File

@ -42,6 +42,8 @@ class OxfordLearning(WebService):
self.cache_this( self.cache_this(
{ {
'phonetic': '{} {}'.format(web_word.wd_phon_bre, web_word.wd_phon_nam), 'phonetic': '{} {}'.format(web_word.wd_phon_bre, web_word.wd_phon_nam),
'phon_bre': '{}'.format(web_word.wd_phon_bre),
'phon_ame': '{}'.format(web_word.wd_phon_nam),
'pos': web_word.wd_pos, 'pos': web_word.wd_pos,
'img_full': web_word.wd_image_full_url, 'img_full': web_word.wd_image_full_url,
'img_thumb': web_word.wd_image_thumb_url, 'img_thumb': web_word.wd_image_thumb_url,
@ -54,6 +56,8 @@ class OxfordLearning(WebService):
self.cache_this( self.cache_this(
{ {
'phonetic': '', 'phonetic': '',
'phon_bre': '',
'phon_ame': '',
'pos': '', 'pos': '',
'img_full': '', 'img_full': '',
'img_thumb': '', 'img_thumb': '',
@ -68,6 +72,14 @@ class OxfordLearning(WebService):
def fld_phonetic(self): def fld_phonetic(self):
return self._get_single_dict('phonetic') return self._get_single_dict('phonetic')
@export('AME_PHON')
def fld_phonetic_us(self):
return self._get_single_dict('phon_ame')
@export('BRE_PHON')
def fld_phonetic_uk(self):
return self._get_single_dict('phon_bre')
@export([u'词性', u'POS']) @export([u'词性', u'POS'])
def fld_pos(self): def fld_pos(self):
return self._get_single_dict('pos') return self._get_single_dict('pos')