orthonym.validation.long_count_read_back#

Note

Internal API. Names and behaviour may change between releases.

A name with a count word above 50, read back without OPSIN, by the reconstructor.

OPSIN 2.9.0 has a numerical term up to 50 (‘pentaconta’) and none above: pentacontane, hectane and pentacontafluorohectane are read, and tetrapentacontafluorohexacosane or a cumulene of 55 carbon atoms is not. The producer spells these names as the Blue Book does, and until this module the gate withdrew every one of them (opsin_unparseable): 24 rows of the BR study, acyclic cumulenes C53 to C113, perfluoro and perbromo alkanes with 51 and more halogen atoms, polyynes, and a few with an alkyl branch.

Basic multiplicative prefixes (the Blue Book, Table 1.4) lists the numerical terms, and

Derivation of basic numerical terms (:2811) composes the others: “composite numerical terms are formed systematically by citing the basic terms in the order opposite to that of the constituent digits in the arabic numbers… formed by direct joining of the basic terms, without hyphen(s). The letter ‘i’ in ‘icosa’ is elided after a vowel.” (examples 52 dopentaconta, 111 undecahecta, 363 trihexacontatricta). Hydrocarbons (:7984) names the saturated unbranched ones the same way, ‘heptacontane (PIN)’.

The check reads the NAME TEXT and nothing else: the parent chain (its numerical term gives its length), the unsaturation (locants and ‘ene’ / ‘yne’ with its multiplier) and the substituent prefixes (locants, multiplier, name) become reconstruct.NameFacts; the reconstructor builds the structure from the facts alone and compares it with the input’s full canonical SMILES, which reconstruct.verify_from_name_facts does with no stereo (it declines an input that asserts any). Nothing is read from the input and nothing from the producer: the count words are composed here again from the Blue Book table, and the producer’s own table (data.chain_names) is only compared with them in a test.

The reader abstains on any token it does not understand, so a name that has anything left over, any locant out of the chain, a locant list that does not match its multiplier, an unknown prefix, a second parse, or no count word above 50 gives no verdict. A false confirmation would be a wrong name: the reader never guesses, and the compare is a full constitution compare. It proves the structure and never the spelling (the order of the prefixes, the enclosing marks, the choice of the parent): the producer owns those, as for the twin spellings (validation.twin_spellings).

The grammar (hydrocarbon chains, hydrogen replaced by halogen or alkyl prefixes):

  • the parent: <term>ane (the numerical term of the chain without its ‘a’,, <term>a-<locants>-<multiplier>ene or yne for several multiple bonds, and <term>-<locant>-ene / yne for one; the locant of a multiple bond is the lower of the two atoms it joins;

  • the prefixes: <locants>-<multiplier><name> blocks in any order, one locant for each multiplied name, a name between enclosing marks when it is compound ((propan-2-yl)), and no locants at all only for halogen prefixes that replace every hydrogen atom of the parent: Omission of locants, “All locants are omitted in compounds or substituent groups in which all substitutable positions are completely substituted or modified… In case of partial substitution or modification, all numerical prefixes must be indicated.” (:3007).

orthonym.validation.long_count_read_back.LONG_COUNT_RULE = 'long_count'#

the rule id of the outcome (reconstructed:long_count)

orthonym.validation.long_count_read_back.numerical_term(n)#

The Blue Book numerical term of n (2..999), composed from Table 1.4, or None.

orthonym.validation.long_count_read_back.name_facts_from_text(name, least_count=51)#

The NameFacts of name, read from its text alone, or None when the name is not wholly understood or cites no count of least_count and above (the class of this reader: names OPSIN has no numerical term for, 51 and above; a lower floor serves the comparison with OPSIN’s own reading, which a test makes).

orthonym.validation.long_count_read_back.long_count_round_trip(name, smiles)#

LONG_COUNT_RULE when the structure the reader builds from the text of name is the constitution of smiles, else None (a name it does not wholly understand, another structure, an input with stereo).