mdx dictionary ignore word case

This commit is contained in:
St.Huang 2018-08-14 14:13:42 +08:00
parent c93982edfd
commit 96432ca023
2 changed files with 4 additions and 4 deletions

View File

@ -576,7 +576,7 @@ class MdxService(LocalService):
def _get_definition_mdx(self): def _get_definition_mdx(self):
"""according to the word return mdx dictionary page""" """according to the word return mdx dictionary page"""
content = self.builder.mdx_lookup(self.word) content = self.builder.mdx_lookup(self.word, ignorecase=True)
str_content = "" str_content = ""
if len(content) > 0: if len(content) > 0:
for c in content: for c in content:
@ -587,7 +587,7 @@ class MdxService(LocalService):
def _get_definition_mdd(self, word): def _get_definition_mdd(self, word):
"""according to the keyword(param word) return the media file contents""" """according to the keyword(param word) return the media file contents"""
word = word.replace('/', '\\') word = word.replace('/', '\\')
content = self.builder.mdd_lookup(word) content = self.builder.mdd_lookup(word, ignorecase=True)
if len(content) > 0: if len(content) > 0:
return [content[0]] return [content[0]]
else: else:

View File

@ -582,7 +582,7 @@ class MdxService(LocalService):
def _get_definition_mdx(self): def _get_definition_mdx(self):
"""according to the word return mdx dictionary page""" """according to the word return mdx dictionary page"""
content = self.builder.mdx_lookup(self.word) content = self.builder.mdx_lookup(self.word, ignorecase=True)
str_content = "" str_content = ""
if len(content) > 0: if len(content) > 0:
for c in content: for c in content:
@ -593,7 +593,7 @@ class MdxService(LocalService):
def _get_definition_mdd(self, word): def _get_definition_mdd(self, word):
"""according to the keyword(param word) return the media file contents""" """according to the keyword(param word) return the media file contents"""
word = word.replace('/', '\\') word = word.replace('/', '\\')
content = self.builder.mdd_lookup(word) content = self.builder.mdd_lookup(word, ignorecase=True)
if len(content) > 0: if len(content) > 0:
return [content[0]] return [content[0]]
else: else: