From f6f7d875ab892188c2467f9b04613ecdeafa5337 Mon Sep 17 00:00:00 2001 From: yu7777 Date: Sat, 21 Sep 2019 11:29:50 +1000 Subject: [PATCH] Update LDOCE5.py --- addons21/fastwq/service/dict/LDOCE5.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/addons21/fastwq/service/dict/LDOCE5.py b/addons21/fastwq/service/dict/LDOCE5.py index 1783a48..e467062 100644 --- a/addons21/fastwq/service/dict/LDOCE5.py +++ b/addons21/fastwq/service/dict/LDOCE5.py @@ -102,13 +102,16 @@ class Ldoce5plus(MdxService): i_str = e[1] sound = e[0] mp3 = self._fld_audio(sound.groups()[0]) - i_str = re.sub(r']+?href=\"sound\:\/.*?\.mp3\".*<\/a>', '', i_str).strip() + i_str = re.sub('<[^<]+?>', '', i_str) + i_str = re.sub('\xa0', '', i_str) + # i_str = re.sub(r']+?href=\"sound\:\/.*?\.mp3\".*<\/a>', '', i_str).strip() # chinese text - cn_text = re.search(r'
(\s*\S*)<\/div><\/span>', i_str) - cn_text_strip = " " - if cn_text: - cn_text_strip = cn_text.groups()[0] - i_str = re.sub(r'(
\s*\S*<\/div>)<\/span>', '', i_str).strip() - my_str = my_str + mp3 + ' ' + i_str + cn_text_strip + '
' + # cn_text = re.search(r'
(\s*\S*)<\/div><\/span>', i_str) + # cn_text_strip = " " + # if cn_text: + # cn_text_strip = cn_text.groups()[0] + # i_str = re.sub(r'(
\s*\S*<\/div>)<\/span>', '', i_str).strip() + # my_str = my_str + mp3 + ' ' + i_str + cn_text_strip + '
' + my_str = my_str + mp3 + ' ' + i_str + '
' return my_str return ''