Distinguishing short and long $Fermi$ gamma-ray bursts