We present an algorithm which for any aperiodic and primitive
substitution outputs a finite representation of
each special word in the shift space associated to that substitution, and determines when such
representations are equivalent under orbit and shift tail equivalence. The
algorithm has been implemented and applied in the study of certain
new invariants for flow equivalence of substitutional dynamical systems.