Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/chemistry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1252,6 +1252,7 @@ fn likely_chem_formula(mathml: Element) -> i32 {
/// there are cases where the outer ordering doesn't match the inner ordering.
/// For "generalized salts", we need to split the elements into positive and negative ions, and within each group
/// the order is suppose to be alphabetical but many use electronegativity (the point being there are two separate groups).
/// The implementation looks like it will be complicated, so at least for now, we don't check that.
/// This site has a nice summary of the rules: https://chemistry.stackexchange.com/questions/537/why-is-arsenous-acid-denoted-h3aso3/538#538
/// Note: "(OH)" doesn't fit with the above, and Susan Jolly suggests allowing any sequence that ends with H, so we allow that.
/// Also, Susan Jolly suggested allowing any compound with C, H, and O
Expand All @@ -1272,8 +1273,7 @@ fn is_order_ok(mrow: Element) -> bool {
has_c_h_o(&elements) ||
is_structural(&elements) ||
is_alphabetical(&elements) ||
is_ordered_by_electronegativity(&elements) ||
is_generalized_salt(&elements);
is_ordered_by_electronegativity(&elements);
}
} else {
return false;
Expand Down Expand Up @@ -1352,11 +1352,6 @@ fn is_ordered_by_electronegativity(elements: &[NameStr<'_>]) -> bool {
});
}

fn is_generalized_salt(elements: &[NameStr<'_>]) -> bool {
assert!(!elements.is_empty());
return false;
}


/// Returns the likelihood that the arg is an adorned chem formula
/// Adornments are:
Expand Down
Loading