remarkov.error

View Source
class NoTransitionsDefined(Exception):
    """
    Generating text from an empty Markov chain does not work.
    """

    def __init__(self):
        super().__init__(
            "The Markov chain does not have any transitions. "
            "This is probably due to invalid operation i.e. generate was called before text was added."
        )


class NoStartStateFound(Exception):
    def __init__(self):
        super().__init__("Couldn't select a valid start state.")


class TokenStreamExhausted(Exception):
    def __init__(self):
        super().__init__(
            "Creating an initial chain state exhausted the token stream. "
            "Choose a lower chain order or provide more input text."
        )
#   class NoTransitionsDefined(builtins.Exception):
View Source
class NoTransitionsDefined(Exception):
    """
    Generating text from an empty Markov chain does not work.
    """

    def __init__(self):
        super().__init__(
            "The Markov chain does not have any transitions. "
            "This is probably due to invalid operation i.e. generate was called before text was added."
        )

Generating text from an empty Markov chain does not work.

#   NoTransitionsDefined()
View Source
    def __init__(self):
        super().__init__(
            "The Markov chain does not have any transitions. "
            "This is probably due to invalid operation i.e. generate was called before text was added."
        )
Inherited Members
builtins.BaseException
with_traceback
args
#   class NoStartStateFound(builtins.Exception):
View Source
class NoStartStateFound(Exception):
    def __init__(self):
        super().__init__("Couldn't select a valid start state.")

Common base class for all non-exit exceptions.

#   NoStartStateFound()
View Source
    def __init__(self):
        super().__init__("Couldn't select a valid start state.")
Inherited Members
builtins.BaseException
with_traceback
args
#   class TokenStreamExhausted(builtins.Exception):
View Source
class TokenStreamExhausted(Exception):
    def __init__(self):
        super().__init__(
            "Creating an initial chain state exhausted the token stream. "
            "Choose a lower chain order or provide more input text."
        )

Common base class for all non-exit exceptions.

#   TokenStreamExhausted()
View Source
    def __init__(self):
        super().__init__(
            "Creating an initial chain state exhausted the token stream. "
            "Choose a lower chain order or provide more input text."
        )
Inherited Members
builtins.BaseException
with_traceback
args