On Some Factorizations of Infinite Words by Elements of Codes

Abstract We show that an infinite word s satisfies s = u0u1u2… with all ui being different nonempty words and their set being a biprefix code if and only if s is not ultimately periodic. We give also related results, considering in particular arbitrary codes, infix codes and the case of two-sided infinite words.