A poor emigrant from Central Europe sailing from Hamburg to America is shipwrecked off the coast of England. The residents of nearby villages, at first unaware of the sinking, and hence of the possibility of survivors, regard him as a dangerous tramp and madman. He speaks no English; his strange foreign language frightens them, and they offer him no assistance.
Eventually "Yanko Goorall" (as rendered in English spelling) is given shelter and employment by an eccentric old local, Mr. Swaffer. Yanko learns a little English. He explains that his given name Yanko means "little John" and that he was a mountaineer (a resident of a mountain area â a Goorall), hence his surname. The story's narrator reveals that Yanko hailed from the Carpathian Mountains.
Yanko falls in love with Amy Foster, a servant girl who has shown him some kindness. To the community's disapproval, they marry. The couple live in a cottage given to Yanko by Swaffer for having saved his granddaughter's life. Yanko and Amy have a son whom Amy calls Johnny (after Little John). Amy, a simple woman, is troubled by Yanko's behavior, particularly his trying to teach their son to pray with him in his "disturbing" language.
Several months later Yanko falls severely ill and, suffering from a fever, begins raving in his native language. Amy, frightened, takes their child and flees for her life. Next morning Yanko dies of heart failure. It transpires that he had simply been asking in his native language for water.

Question: Why does Swaffer give Yanko a cottage?
Answer: He saved his grandddaughter's life.
Alternative answer: for saving his granddaughter's life