orthonym.assembly.prefix_derivation#

Note

Internal API. Names and behaviour may change between releases.

A substituent prefix name that carries how its writer built it.

  1. (the Blue Book): “any component which is substituted automatically

requires use of the multiplicative forms ‘bis’, ‘tris’, etc.” Whether a prefix is substituted is a fact of the derivation its writer chose (‘tert-butyl’ is simple, ‘2-methylpropan-2-yl’ is substituted; ‘bicyclo[3.2.1]octan-3-yl’ is simple although it holds brackets, (f):7104), so the writer records it with the name it returns.

The value is a str subclass: it equals, hashes, sorts and serialises as its text, so dict keys, sort keys, JSON and the memo are unchanged. Pickle and copy keep the record; any string operation (slice, strip, f-string, concatenation) returns a plain str without it, and a name without a record is decided as before (derivation_of returns None). A writer step that adds marks or a descriptor to a recorded name keeps the record with:func:carried.

class orthonym.assembly.prefix_derivation.PrefixDerivation(substituted, enclosed=None)#

Bases: object

substituted: the writer attached at least one detachable substituent prefix to the parent group of this prefix (c), (a); compound and complex groups, /. enclosed: the prefix takes enclosing marks wherever it is cited, the Blue Book), as its writer decided; None leaves the marks to the predicates of naming_utils.

substituted: bool#
enclosed: bool | None = None#
class orthonym.assembly.prefix_derivation.PrefixName(text, derivation)#

Bases: str

The text of a substituent prefix and the PrefixDerivation of its writer.

orthonym.assembly.prefix_derivation.built(text, *, substituted, enclosed=None)#

text as returned by its writer, with the writer’s facts; None stays None.

orthonym.assembly.prefix_derivation.carried(text, like)#

text is like with marks or a descriptor added by the same writer chain: it keeps the record of like (none when like has none).

orthonym.assembly.prefix_derivation.derivation_of(name)#

The writer’s record of name, or None for a name without one.

orthonym.assembly.prefix_derivation.with_derivation(text, rec)#

text with the record rec (unchanged when either is None).