dan2097 / opsin

Open Parser for Systematic IUPAC Nomenclature. Chemical name to structure conversion
https://opsin.ch.cam.ac.uk
MIT License
155 stars 32 forks source link

Make space after semi-colon optional #235

Open johnmay opened 11 months ago

johnmay commented 11 months ago

Some salt names use a semi-colon to indicate the salt. OPSIN supports this is but only as "; "

Example name

(2S,4R)-1-[(2S)-2-amino-3,3-dimethyl-butanoyl]-4-hydroxy-N-[[4-(4-methylthiazol-5-yl)phenyl]methyl]pyrrolidine-2-carboxamide;hydrochloride

dan2097 commented 11 months ago

; is implemented in a really weird way (it's fudged as a space). I think it should be simple enough to support semicolon more like how space/hyphen are allowed as delimiters between words. I should have time to finish testing the fix later this week.

johnmay commented 11 months ago

No rush, I fudge it in the reaction extractor anyways :-). Just thought a useful addition/relaxation.

dan2097 commented 11 months ago

No rush, I fudge it in the reaction extractor anyways :-). Just thought a useful addition/relaxation.

Yeah I think it's definitely a good idea. My initial idea of treating this identically to space/hyphen was too simplistic as while say benzene;toluene is probably fine I don't think ethyl;benzene should be interpreted as ethylbenzene