CambridgeMolecularEngineering / chemdataextractor2

ChemDataExtractor Version 2.0
Other
121 stars 28 forks source link

Added recognition for ratios expressed with colons #41

Open jerry-yyy opened 1 year ago

jerry-yyy commented 1 year ago

Modified the quantity.py file to include functionality for recognizing fractions/ratios that are expressed using a colon (e.g., Molar Raio '1:2'), in addition to the existing slash-based format (e.g., '1/2').

Dingyun-Huang commented 8 months ago

Thank you for making this PR. I would suggest to create a separate expression named ratio instead of editing the fraction expression because ratio and fraction do have different meanings. Then add ratio as number = spaced_power_number | fraction | pure_number | ratio.

Otherwise, the change looks good to me 👍 .