This paper deals with two types of repetitions in strings: squares, which consist of two adjacent occurrences of substrings, and runs, which are periodic substrings that cannot be extended further to the left or right. We show how to compute all the primitively-rooted squares in a given partial word, which is a sequence that may have undefined positions, called holes or wildcards, that match any letter of the alphabet over which the sequence is defined. We also describe an algorithm for computing all primitively-rooted runs in a given partial word.
展开▼