diff --git a/src/fastwq/service/oxford_learning.py b/src/fastwq/service/oxford_learning.py index 3cc7995..3feb76e 100644 --- a/src/fastwq/service/oxford_learning.py +++ b/src/fastwq/service/oxford_learning.py @@ -10,9 +10,7 @@ import sys #reload(sys) #sys.setdefaultencoding('utf8') -BASE_URL = u'https://www.oxfordlearnersdictionaries.com/definition/english/{word}' - -@register(u'牛津学习词典') +@register([u'牛津学习词典', u'Oxford Learner']) class OxfordLearning(WebService): def __init__(self): @@ -23,7 +21,7 @@ class OxfordLearning(WebService): :param word: :rtype: WebWord """ - qry_url = BASE_URL.format(word=word) + qry_url = u'https://www.oxfordlearnersdictionaries.com/definition/english/{}'.format(word) retried = 10 while retried: @@ -61,15 +59,15 @@ class OxfordLearning(WebService): ) return self.cache_result(single_dict) - @export(u'音标', 0) + @export('PHON', 0) def phonetic(self): return self._get_single_dict('phonetic') - @export(u'词性', 1) + @export([u'词性', u'POS'], 1) def pos(self): return self._get_single_dict('pos') - @export(u'释义', 2) + @export('DEF', 2) @with_styles(cssfile='_oxford.css') def ee(self): # return '