I assumed that one of the pirates acted as a caretaker for the child and advised her to act as a man. This is sometimes seen in works of fiction. I think there is too little information to really know for sure.