A teacher from York who sexually groomed a teenage girl during sordid online chats has been jailed for more than two years.