When a workmate went outside to speak to him, Rahiri handed over a love letter which said he was shy, wasn't married and had wanted to ask her for her phone number.
He signed the letter "always thinking of you", and gave his cellphone number.
The girl was shaken and upset by the letter and showed it to her boss, who threatened Rahiri with a trespass order.
His visits to the supermarket stopped, but a week later a bouquet of red roses arrived at the girl's grandparents' home.
Another time, the girl had been performing at a music festival on Matakana Island near Tauranga when she saw Rahiri walking towards her.
She tried to lose herself in the crowd, but Rahiri walked up behind her, tapped her on the shoulder and said he had to talk to her.
After Rahiri tried to see the girl at her grandparents' house, she left town.
Rahiri tried to reach the girl by phoning her grandparents and telling them he had fears for her safety.
The harassment resumed when the girl returned to Te Puke and her old job at the supermarket this year.
On April 7, Rahiri visited the supermarket and then waited outside watching the girl, who phoned her grandfather for help. When he pulled up next to Rahiri, the accused said he was waiting for a friend.
On April 20, Rahiri sent a bouquet of flowers with an attached note including the postscript: "I know how to use my phone."
Police eventually spoke to Rahiri in May and charged him with wilful trespass and criminal harassment.
In the Tauranga District Court yesterday, Rahiri's lawyer, Cate Andersen, said he was a "highly functional" person but was affected by an "encapsulated delusional system".
Rahiri had claimed he could telepathically communicate with his wife of 28 years, who died of cancer shortly before his offending began, and also received telepathic communications during his visits to the supermarket.
"What we have here is an issue that does need to be addressed by a psychologist," Ms Andersen said.
The court heard how Rahiri's life had straightened out nine years ago after involvement with the Filthy Few gang and problems with drugs and alcohol.
But Judge Lindsay Moore told Rahiri he had made a "complete mess of it" with his harassment of the girl, which he described as "bizarre and frightening" and a "deeply worrying matter".
Judge Moore said it was difficult to tell where Rahiri's delusion stopped and his game-playing began.
He sentenced Rahiri to 160 hours of community work and 15 months of intensive supervision and told him that if he continued offending there would be only one way to keep him away from the girl.
"That will be to lock you up - and that would be a tragedy to you."