orthonym.validation.spelling.models#
Note
Internal API. Names and behaviour may change between releases.
Shared readings of a name for the spelling checks: the abstention marks, the parsed units of a name, and the numbering models of parents whose numbering symmetries are known from the name alone (an unbranched carbon chain, a carbocyclic, retained or Hantzsch-Widman monocycle, naphthalene, anthracene). No naming code, no OPSIN.
- orthonym.validation.spelling.models.P10 = re.compile('(pyranos|furanos|osyl|uronic|ose\\b|osid|glycer|L-|D-|DL-|\\bα-|\\bβ-|adenosin|guanosin|uridin|cytidin|thymidin|inosin|cholest|androst|pregn|estr|gonan|morphinan|ergolin|abieta|labda|kaura|carotene|r)#
lexical marks of the classes (carbohydrates, nucleosides, stereoparents, amino acids and peptides, carotenoids, coordination names): the substitutive checks abstain on them
- orthonym.validation.spelling.models.show(text)#
A unit’s text for a failure detail: child enclosures shown as ‘(…)’.
- orthonym.validation.spelling.models.read_units(name)#
parse_name(name), or None when the marks do not pair (the check reports that).
- orthonym.validation.spelling.models.RINGS = {'1,2,3-triazol': (5, {1: 'N', 2: 'N', 3: 'N'}, True), '1,2,4-oxadiazol': (5, {1: 'O', 2: 'N', 4: 'N'}, True), '1,2,4-thiadiazol': (5, {1: 'S', 2: 'N', 4: 'N'}, True), '1,2,4-triazin': (6, {1: 'N', 2: 'N', 4: 'N'}, True), '1,2,4-triazol': (5, {1: 'N', 2: 'N', 4: 'N'}, True), '1,2,5-oxadiazol': (5, {1: 'O', 2: 'N', 5: 'N'}, True), '1,2,5-thiadiazol': (5, {1: 'S', 2: 'N', 5: 'N'}, True), '1,2-oxazol': (5, {1: 'O', 2: 'N'}, True), '1,2-oxazolidin': (5, {1: 'O', 2: 'N'}, False), '1,2-thiazol': (5, {1: 'S', 2: 'N'}, True), '1,3,4-oxadiazol': (5, {1: 'O', 3: 'N', 4: 'N'}, True), '1,3,4-thiadiazol': (5, {1: 'S', 3: 'N', 4: 'N'}, True), '1,3,5-triazin': (6, {1: 'N', 3: 'N', 5: 'N'}, True), '1,3-dioxan': (6, {1: 'O', 3: 'O'}, False), '1,3-dioxolan': (5, {1: 'O', 3: 'O'}, False), '1,3-dithiolan': (5, {1: 'S', 3: 'S'}, False), '1,3-oxazol': (5, {1: 'O', 3: 'N'}, True), '1,3-oxazolidin': (5, {1: 'O', 3: 'N'}, False), '1,3-thiazol': (5, {1: 'S', 3: 'N'}, True), '1,3-thiazolidin': (5, {1: 'S', 3: 'N'}, False), '1,4-dioxan': (6, {1: 'O', 4: 'O'}, False), 'azepan': (7, {1: 'N'}, False), 'azetidin': (4, {1: 'N'}, False), 'aziridin': (3, {1: 'N'}, False), 'azocan': (8, {1: 'N'}, False), 'furan': (5, {1: 'O'}, True), 'imidazol': (5, {1: 'N', 3: 'N'}, True), 'imidazolidin': (5, {1: 'N', 3: 'N'}, False), 'morpholin': (6, {1: 'O', 4: 'N'}, False), 'oxan': (6, {1: 'O'}, False), 'oxepan': (7, {1: 'O'}, False), 'oxetan': (4, {1: 'O'}, False), 'oxiran': (3, {1: 'O'}, False), 'oxolan': (5, {1: 'O'}, False), 'piperazin': (6, {1: 'N', 4: 'N'}, False), 'piperidin': (6, {1: 'N'}, False), 'pyrazin': (6, {1: 'N', 4: 'N'}, True), 'pyrazol': (5, {1: 'N', 2: 'N'}, True), 'pyrazolidin': (5, {1: 'N', 2: 'N'}, False), 'pyridazin': (6, {1: 'N', 2: 'N'}, True), 'pyridin': (6, {1: 'N'}, True), 'pyrimidin': (6, {1: 'N', 3: 'N'}, True), 'pyrrol': (5, {1: 'N'}, True), 'pyrrolidin': (5, {1: 'N'}, False), 'tetrazol': (5, {1: 'N', 2: 'N', 3: 'N', 4: 'N'}, True), 'thian': (6, {1: 'S'}, False), 'thietan': (4, {1: 'S'}, False), 'thiiran': (3, {1: 'S'}, False), 'thiolan': (5, {1: 'S'}, False), 'thiomorpholin': (6, {1: 'S', 4: 'N'}, False), 'thiophen': (5, {1: 'S'}, True)}#
element}, mancude)
- Type:
retained and Hantzsch-Widman monocycles
- Type:
name stem -> (size, {locant
- orthonym.validation.spelling.models.ELEMENT_LOCANT = re.compile("([A-Z][a-z]?)(\\d*)('*)")#
its element, superscript and primes
- Type:
an element locant (‘N’, ‘N4’, “N’”, ‘O’)
- orthonym.validation.spelling.models.int_locs(locs)#
- orthonym.validation.spelling.models.ring_or_chain_model(p, is_subst_unit)#
(kind, n, perms, feats) of a unit whose parent’s numbering symmetries are known from the name alone (an unbranched carbon chain, a carbocyclic or retained / Hantzsch-Widman monocycle, naphthalene, anthracene), or None.
feats['prefix']holds (key, locants) of the prefixes on numbered positions,feats['prefix_src']the prefixes themselves in the same order (a prefix whose locants are all element locants goes tofeats['letter']).
- orthonym.validation.spelling.models.bond_loc(a, b, n, kind)#
- orthonym.validation.spelling.models.vector(feats, mp, n, kind, letters_first=True)#
The locant sets of a unit under numbering
mp, in the order of the criteria.letters_first: an element locant (‘N4’) ranks below a numeral,:3195); False ranks it above (the order the PIN ‘N4,2-dimethylpentane-2,4-diamine’:26371 needs).