bug fixes.

This commit is contained in:
St.Huang 2018-10-01 14:15:03 +08:00
parent 04dabf4803
commit e64501cdb7
2 changed files with 16 additions and 4 deletions

View File

@ -32,12 +32,18 @@ class BingXtk(WebService):
@export('AME_PHON')
def fld_phonetic_us(self):
seg = self._get_field('pronunciation')
return seg.get('AmE', u'') if seg else u''
phon = seg.get('AmE', u'') if seg else u''
if phon and phon[0:1] not in '/[':
return u'/{}/'.format(phon)
return u''
@export('BRE_PHON')
def fld_phonetic_uk(self):
seg = self._get_field('pronunciation')
return seg.get('BrE', u'') if seg else u''
phon = seg.get('BrE', u'') if seg else u''
if phon and phon[0:1] not in '/[':
return u'/{}/'.format(phon)
return u''
def _fld_mp3(self, fld):
seg = self._get_field('pronunciation')

View File

@ -32,12 +32,18 @@ class BingXtk(WebService):
@export('AME_PHON')
def fld_phonetic_us(self):
seg = self._get_field('pronunciation')
return seg.get('AmE', u'') if seg else u''
phon = seg.get('AmE', u'') if seg else u''
if phon and phon[0:1] not in '/[':
return u'/{}/'.format(phon)
return u''
@export('BRE_PHON')
def fld_phonetic_uk(self):
seg = self._get_field('pronunciation')
return seg.get('BrE', u'') if seg else u''
phon = seg.get('BrE', u'') if seg else u''
if phon and phon[0:1] not in '/[':
return u'/{}/'.format(phon)
return u''
def _fld_mp3(self, fld):
seg = self._get_field('pronunciation')