(self, value: str | ContentDetector.Components)
| 201 | """Characters to ignore.""" |
| 202 | |
| 203 | def __init__(self, value: str | ContentDetector.Components): |
| 204 | if isinstance(value, ContentDetector.Components): |
| 205 | self._value = value |
| 206 | else: |
| 207 | translation_table = str.maketrans( |
| 208 | {char: " " for char in ScoreWeightsValue._IGNORE_CHARS} |
| 209 | ) |
| 210 | values = value.translate(translation_table).split() |
| 211 | if not len(values) == 4: |
| 212 | raise ValueError("Score weights must be specified as four numbers!") |
| 213 | self._value = ContentDetector.Components(*(float(val) for val in values)) |
| 214 | |
| 215 | @property |
| 216 | def value(self) -> ContentDetector.Components: |
nothing calls this directly
no outgoing calls
no test coverage detected