| Conditions | 3 |
| Total Lines | 11 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Vocabulary management functionality for Annif""" |
||
| 28 | @property |
||
| 29 | def subjects(self): |
||
| 30 | if self._subjects is None: |
||
| 31 | path = os.path.join(self.datadir, 'subjects') |
||
| 32 | if os.path.exists(path): |
||
| 33 | logger.debug('loading subjects from %s', path) |
||
| 34 | self._subjects = annif.corpus.SubjectIndex.load(path) |
||
| 35 | else: |
||
| 36 | raise NotInitializedException( |
||
| 37 | "subject file {} not found".format(path)) |
||
| 38 | return self._subjects |
||
| 39 | |||
| 44 |