| Total Complexity | 3 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """Support for exclude/include rules for subject vocabularies""" |
||
| 2 | |||
| 3 | from annif.exception import ConfigurationException |
||
| 4 | |||
| 5 | |||
| 6 | def kwargs_to_exclude_uris(kwargs: dict[str, str]) -> set[str]: |
||
| 7 | exclude_uris = set() |
||
| 8 | for key, value in kwargs.items(): |
||
| 9 | vals = value.split("|") |
||
| 10 | if key == "exclude": |
||
| 11 | exclude_uris.update(vals) |
||
| 12 | else: |
||
| 13 | raise ConfigurationException(f"unknown vocab keyword argument {key}") |
||
| 14 | return exclude_uris |
||
| 15 |