(self, data)
| 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 = '' |
no test coverage detected