Detecting hidden patterns in the dynamics of play in team sports