MCPcopy
hub / github.com/skywind3000/ECDICT / word_tag

Method word_tag

dictutils.py:46–69  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

44 self._term_name = names
45
46 def word_tag (self, data):
47 tag = data.get('tag', '')
48 text = ''
49 for term in self._term_name:
50 if not tag:
51 continue
52 if not term in tag:
53 continue
54 text += self._terms[term]
55 frq = data.get('frq')
56 if isinstance(frq, str) or isinstance(frq, unicode):
57 if frq in ('', '0'):
58 frq = None
59 if not frq:
60 frq = '-'
61 bnc = data.get('bnc')
62 if isinstance(bnc, str) or isinstance(bnc, unicode):
63 if bnc in ('', '0'):
64 bnc = None
65 if not bnc:
66 bnc = '-'
67 if bnc != '-' or frq != '-':
68 text += ' %s/%s'%(frq, bnc)
69 return text.strip()
70
71 def word_level (self, data):
72 head = ''

Callers 4

compile_stardictMethod · 0.95
compile_mdxMethod · 0.95
_generate_htmlMethod · 0.95
get_levelMethod · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected