Skip to content

protocol

Protocol for similar a words generator.

SimilarWordsGenerator

Bases: Protocol

Protocol for similar a words generator.

Source code in src/sesg/similar_words/protocol.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
class SimilarWordsGenerator(Protocol):
    """Protocol for similar a words generator."""

    def __call__(self, word: str) -> list[str]:  # pragma: no cover
        """Interface of a function that generates similar words.

        Args:
            word (str): Word from which to find similar words.

        Returns:
            List of similar words.
        """
        raise NotImplementedError()

__call__(word)

Interface of a function that generates similar words.

Parameters:

Name Type Description Default
word str

Word from which to find similar words.

required

Returns:

Type Description
list[str]

List of similar words.

Source code in src/sesg/similar_words/protocol.py
 9
10
11
12
13
14
15
16
17
18
def __call__(self, word: str) -> list[str]:  # pragma: no cover
    """Interface of a function that generates similar words.

    Args:
        word (str): Word from which to find similar words.

    Returns:
        List of similar words.
    """
    raise NotImplementedError()