@staticmethod
def is_valid_wordfreq(word, freq):
    """Validate word and frequency."""
    if not isinstance(word, str):
        raise ValueError(f'word {word} must be a string')
    if not (freq is not None and isinstance(freq, int) and freq != 0):
        raise ValueError(
            f'The frequency {freq} for {word} must be an integer and cannot be zero'
            )
    return True
