Chemical Structure Elucidation from Mass Spectrometry by Matching Substructures