Text::Conversation

Turn a conversation into threads, one line at a time.
Download

Text::Conversation Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Rocco Caputo
  • Publisher web site:
  • http://search.cpan.org/~apocal/

Text::Conversation Tags


Text::Conversation Description

Turn a conversation into threads, one line at a time. Text::Conversation is a Perl module to turn a conversation into threads, one line at a time.SYNOPSIS #!perl use warnings; use strict; use Text::Conversation; my $threader = Text::Conversation->new(); my %messages; while () { next unless my ($speaker_name, $their_text) = /^(S+)s+(S.*?)s*$/; my ($this_message_id, $referent_message_id) = $threader->observe($speaker_name, $their_text); $messages{$this_message_id} = " $their_text"; print $messages{$this_message_id}, " "; if ($referent_message_id) { print " refers to: $messages{$referent_message_id} "; } else { print " doesn't refer to anything. "; } }Text::Conversation attempts to thread conversational text one line at a time. Given a speaker's ID (often a name, screen name, or other relatively unique identifier) and the text of their message, it attempts to find the most likely message they are referring to. It will also indicate times when it cannot find a referent.The most common question so far is "How does it work?" That's often followed by the leading "Does it just look for another speaker's ID at the start of the message?" Text::Conversation uses multiple heuristics to determine a message's referent. To be sure, the presence of another speaker's ID counts for a lot, but so common words between two messages. Consider them similar to quoted text in an e-mail message.Text::Conversation also keeps track of people who have spoken to each other, either explicitly or implicitly. Chances are good that an otherwise undirected message is aimed at a person is part of an ongoing conversation.The module also incorporates penalties. The link between two messages is degraded more as the module searches farther back in time. Likewise, there are penalties for referring to messages beyond the speaker's previous message, or the addressee's.Text::Conversation is considered by its author to be "beta" quality code. The heuristics are often uncannily accurate... if you steadfastly ignore their shortcomings. I am trapped in a module factory. Please send feedback and patches. Requirements: · Perl


Text::Conversation Related Software