Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing Complex Formulae #20

Open
sabidhasan opened this issue Dec 24, 2017 · 2 comments
Open

Parsing Complex Formulae #20

sabidhasan opened this issue Dec 24, 2017 · 2 comments

Comments

@sabidhasan
Copy link

Hello,

Would you be open to a modification of the atomicMass function that allows it to parse complex formulae?

I mean two things by this:

  1. Natural formulas with no spaces between the elements (C6H12O6 rather than C6 H12 O6)
  2. Brackets (eg C2[Cr(H2O)4]2N2 for the sake of illustration)

I wrote a Python module at one point with this functionality so it should be pretty easy to port to JS.

If interested, I can fork and make a PR

@sabidhasan sabidhasan changed the title Formulae Parsing Complex Formulae Dec 24, 2017
@ekuester
Copy link

ekuester commented Nov 6, 2018

@sabidhasan perhaps you are interested for a similar solution in C++? Then take a look at my repository GTK-Periodic-Table-Molecular-Formula ...

@Papayaman1000
Copy link

Might I recommend adding a separate helper function that would format a given complex string into one more readable by functions like atomicMass? I could write one up and make a PR fairly easily if need be; I've worked on a similar project in JS before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants