Recurrence and Periodicity in Infinite Words from Local Periods