Next / Previous / Contents / Shipman's homepage

29. class CollBind: Cluster of colliding codes

An instance of this class represents a set of codes that are involved in a collision, that is, a case where the application of the standard abbreviation rules to two or more names produces the same code. That code is then disallowed for use in live data.

For a general discussion of symbol table structure, see Section 25, “class AbSym: One symbol table entry”. In particular, CollBind is the only class derived from AbBind in which the .combine() method doesn't raise an exception.

When evidence of a collision is first detected during processing of the standard forms file or the alternate forms file, the symbol table entry for the collision code is created and bound to a CollBind instance. Each additional time the collision code turns up in the input, its CollBind instance is combined with the existing one, so that when the input is all processed, the symbol table entry for the collision code will contain a set of all the related disambiguated codes.

# - - - - -   c l a s s   C o l l B i n d

class CollBind(AbBind):
    '''Represents a set of colliding names and their disambiguation.

        CollBind ( abbr, collSet ):
          [ (abbr is a stripped, uppercased bird code) and
            (collSet is a set of stripped, uppercased bird codes) ->
              return a new CollBind instance representing
              abbr as a collision code and collSet the set
              of disambiguated alternatives ]
        .abbr:        [ as passed to constructor, read-only ]
          [ a set containing all the disambiguated codes related
            to self.abbr ]
        .writeFlat ( outFile ):
          [ outFile is a writeable file ->
              outFile  +:=  flat collision file records
                            representing self ]
        .writeXML ( parent ):
          [ parent  :=  parent with a new rnc.COLLISION_N element
                representing self ]