 Although the book is set in 1812, the film is set 7 years earlier.  This afforded the writers the chance to make the enemy of the piece  not the United States but France, England at the time having  declared war against Napoleon.