In the 18-19th centuries a ship was defined as a first rank sailing vessel having a bowsprit and three or more square-rigged masts (ship-rigged), each composed of a lowermast, a topmast, and often a topgallant mast.
My maritime law books define a ship as having 'a continuous upper deck.'