Skip to content

yex.box.Penalty

yex.box.Penalty(demerits) #

Bases: yex.box.gismo.Gismo

The cost of breaking the line at this place.

When we divide a paragraph into lines, some places are better to break at than others. Usually we work these out automatically, but this instructs the algorithm specifically.

Attributes:

Name Type Description
demerits int

the cost of breaking at this place.

Source code in yex/box/gismo.py
335
336
337
def __init__(self, demerits):
    super().__init__()
    self.demerits = demerits