116 """Normalize a mapping of keys to word iterables into key to word sets.
118 Transforms each value in the mapping through normalize(). The function
119 does not assume any particular key type; callers should validate keys
120 where necessary. None values are transformed to empty sets.
123 mapping: Dictionary with arbitrary keys and word iterables as values.
126 Dict[object, Set[str]]: Mapping with same keys but normalized word sets as values.
128 Normalise.disp.log_debug(
"load_mapping called")
130 out: Dict[object, Set[str]] = {}
132 for key, words
in mapping.items():
137 out[key] = Normalise.normalize(words)
139 Normalise.disp.log_info(f
"load_mapping produced {len(out)} entries")