This is the 420th most frequent Czech word.
ni
The Czech word "ni" is a third-person feminine singular pronoun in the dative or locative case, meaning "her" or "on her" depending on context.
The word 'ní' is the dative form meaning 'to her' and refers to the woman he is going towards.
Šel k ní, aby jí předal dárek.
He went to her to give her a gift.
The word 'ni' here is in accusative and refers to the woman who is the object of his thoughts.
Nemohl na ni přestat myslet.
He could not stop thinking about her.
In this sentence, 'ni' again appears in accusative form and maintains its role as referring to the woman.