# simplebayes.category module

class simplebayes.category.BayesCategory(name: str)

  Bases: `object`

  Represents a trainable category of content for bayesian classification

  get_tally() → int

    Gets the tally of all types

    Returns:

      The total number of tokens

    Return type:

      int

  get_token_count(word: str) → int

    Gets the count associated with a provided token/word

    Parameters:

      word (str) – the token we’re getting the weight of

    Returns:

      the weight/count of the token

    Return type:

      int

  train_token(word: str, count: int) → None

    Trains a particular token (increases the weight/count of it)

    Parameters:

      - word (str) – the token we’re going to train

      - count (int) – the number of occurrences in the sample

  untrain_token(word: str, count: int) → None

    Untrains a particular token (decreases the weight/count of it)

    Parameters:

      - word (str) – the token we’re going to train

      - count (int) – the number of occurrences in the sample