=head1 NAME

OpenDirectory::Matcher -- engine matching text to categories.

=cut





package OpenDirectory::Matcher;


use strict;

use Data::Dumper;

use OpenDirectory::Category;
use OpenDirectory::MatchResult;





=head1 PROPERTIES

=head2 noResultMax

The maximum number of categories returned in the 
OpenDirectory::MatchResult object after a match. The best 
matches are returned.

Default: 30

=cut
sub noResultMax { my $self = shift; my $pkg = ref($self);
	my ($val) = @_;

	if(defined($val)) {
		$self->{noResultMax} = $val;
		}

	return($self->{noResultMax});
	}





=head1 METHODS

=head2 new()

Create new object.

=cut
sub new { my $pkg = shift; $pkg = ref($pkg) || $pkg;

	my $self = {
		};
	bless $self, $pkg;

	$self->noResultMax(30);	

	return($self);
	}





=head2 objMatch([-text => $text], [-url => $url], [-title => $title])

Match the data (text/url/title) against the categories.

Return a OpenDirectory::MatcherResult, or undef on errors.

=cut
sub objMatch { my $self = shift; my $pkg = ref($self);
	
	die("Override using a specific Matcher method");

	return(1);
	}





=head1 AUTHOR

Johan Lindström - johanl@bahnhof.se

Copyright (c) 2002.. Johan Lindström. All rights reserved. 
This program is free software; you can redistribute it 
and/or modify it under the same terms as Perl itself.

=cut





1;





#EOF
