Spectral approximation of generalized Schr\"odinger operators via approximation of subwords