Syntactic structures and the general Markov models