X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FAnnTalk.pm;h=58c2a4394460d2cdd11671a10f2e94678601557c;hb=f87323c2926605792ee02b84783d8f3d4dbd605f;hp=b48dc7e0ca56f58a1bc8ed5693541cf89d6bbc93;hpb=6ccc3a6e864a2fee18786a7070400c7c4f22cf7c;p=spider.git diff --git a/perl/AnnTalk.pm b/perl/AnnTalk.pm index b48dc7e0..58c2a439 100644 --- a/perl/AnnTalk.pm +++ b/perl/AnnTalk.pm @@ -38,7 +38,7 @@ $filterdef = bless ([ use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); $main::build += $VERSION; $main::branch += $BRANCH; @@ -62,6 +62,21 @@ sub listdups return DXDupe::listdups('A', $dupage, @_); } - +# is this text field a likely announce to talk substitution? +# this may involve all sorts of language dependant heuristics, but +# then again, it might not +sub is_talk_candidate +{ + my ($from, $text) = @_; + my $call; + ($call) = $text =~ /^\s*(?:[Xx]|[Tt][Oo]?:?)\s+([\w-]+)/; + ($call) = $text =~ /^\s*>\s*([\w-]+)\b/ unless $call; + ($call) = $text =~ /^\s*([\w-]+):?\b/ unless $call; + if ($call) { + $call = uc $call; + return is_callsign($call); + } + return undef; +} 1;