Discourse-level Analysis Algorithm