X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FAnnTalk.pm;h=0269edaa1e7a9ea4150fff83f9dccaf5efa65e5a;hb=a79ed63d7b2c53c1f360512afa2a68ba311b9554;hp=982e9c49afc9eb99b679ac180ecbdab8a48af0a4;hpb=47597a3f8635c4d4de89419c0c808ddcda59b9d5;p=spider.git diff --git a/perl/AnnTalk.pm b/perl/AnnTalk.pm index 982e9c49..0269edaa 100644 --- a/perl/AnnTalk.pm +++ b/perl/AnnTalk.pm @@ -27,13 +27,13 @@ $filterdef = bless ([ ['group', 't', 3], ['origin', 'c', 4], ['wx', 't', 5], - ['channel', 'n', 6], - ['by_dxcc', 'n', 7], - ['by_itu', 'n', 8], - ['by_zone', 'n', 9], - ['origin_dxcc', 'n', 10], - ['origin_itu', 'n', 11], - ['origin_itu', 'n', 12], + ['channel', 'c', 6], + ['by_dxcc', 'nc', 7], + ['by_itu', 'ni', 8], + ['by_zone', 'nz', 9], + ['origin_dxcc', 'nc', 10], + ['origin_itu', 'ni', 11], + ['origin_zone', 'nz', 12], ], 'Filter::Cmd'); use vars qw($VERSION $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;