Coherence in natural language. Data structures and applications