A “defenceless” teenager “is lucky to be alive” after she was attacked with a sword by a 15-year-old boy, police have said.