Sean Shearer (25) admitted raping his victim on three occasions at a house in the town between July 1, 2014 and January 31, 2015.
The High Court in Glasgow heard that the first time it happened the woman, who cannot be named for legal reasons, woke up and told Shearer ”stop,” but he ignored her.
The victim asked Shearer why it had happened and he told her he thought she wanted to have sex, but did not say what made him think that.
You may also be interested in:
When she told Shearer she had been asleep he insisted she was awake.
On the other two occasions the woman said nothing.
She eventually told a friend what had happened and she said “that’s not right” and urged her to contact the police.
The woman did not contact the police until 2016.
Defence counsel Margaret Breslin, representing Shearer, said: “He was diagnosed with Aspergers and has a problem understanding what is said to him. That could well have contributed to his present position.
“However, he does now recognise that what he did was wrong. At the time of the offence he was 20 and the complainer was 17.”
Shearer is assessed as a medium risk of sexual reoffending and was placed on the sex offenders register.
Ms Breslin asked judge Lord Woolman not to jail Shearer, but to order him to perform unpaid work in the community and put him on a curfew.
However Lord Woolman told Shearer: “This case can only be deal with by a substantial custodial sentence. You pled guilty to a charge of rape.
“On three separate occasions you raped a sleeping woman.
“She woke and found you having sexual intercourse with her. That is a serious offence.”