Skip to main content

Module smiles

Module smiles 

Source
Expand description

SMILES-based functional group detection and chapter-level HS classification.

This module provides a pattern-matching engine that inspects a canonical SMILES string and infers:

  1. Organic vs. inorganic classification
  2. Functional groups present (up to 20 categories)
  3. HS chapter / heading hint (approximate, confidence ≤ 0.70)

The engine is used as Priority 3 in HsPipeline::classify when the CAS rule table (Priority 2) finds no match but a SMILES string is available.

§Example

use hs_predict::smiles::classify_smiles;
use hs_predict::smiles::detector::FunctionalGroup;

let result = classify_smiles("CC(C)=O").unwrap(); // acetone
assert_eq!(result.heading_hint.heading, Some(2914)); // ketone → 29.14

Re-exports§

pub use chapter_map::HeadingHint;
pub use detector::FunctionalGroup;

Modules§

chapter_map
Maps detected functional groups to HS chapter / heading hints.
detector
Organic / inorganic detection and functional group detection from SMILES.

Structs§

SmilesClassification
Result of SMILES-based functional group analysis and HS heading estimation.

Functions§

classify_smiles
Analyse a SMILES string and return a chapter-level HS classification hint.