Comparison of text structures