couple module

class py_amr2fred.couple.Couple(occurrence, word)

Bases: object

A class representing a pair of a word and its occurrence count.

The Couple class stores a word and its associated occurrence count. It provides methods to retrieve the word, the count, update the count, and increment the occurrence count.

Parameters:
  • occurrence – The initial occurrence count of the word.

  • word – The word associated with the occurrence count.

get_occurrence() int

Returns the occurrence count of the word.

Returns:

The occurrence count.

Return type:

int

get_word() str

Returns the word associated with the Couple instance.

Returns:

The word.

Return type:

str

increment_occurrence()

Increments the occurrence count by 1.

set_occurrence(occurrence)

Sets the occurrence count for the word.

Parameters:

occurrence – The new occurrence count to set.