Let M be a submonoid of the free monoid A∗, and let X ⊆ M be a variable length code (for short a code). X is weakly M-complete if any word in M is a factor of some word in X∗ [J. Néraud, C. Selmi, Free monoid theory: maximality and completeness in arbitrary submonoids, Internat. J. Algorithms Comput. 13(5) (2003) 507–516]. Given a code X ⊆ M , we are interested in the construction of a weakly M...