in reply to Re^4: RFC - Documentation Review
in thread Please review documentation of my AI::Embedding module
I don't understand. Either that or I haven't properly explained what the comparator does.
The comparator method doesn't do any work other than to set a value to be compared with the compare method. So these two are exactly equivalent:
my $difference = $embedding->compare($embed2, $embed1); $embedding->comparator($embed1); my $difference = $embedding->compare($embed2);The only time it makes any sense to use the comparator method is when there are lots of values to compare to the same thing:
In my understanding, a comparator is a device that compares things. I'm thinking of something like an LM393, or the optional block or function name passed to sort.
What your comparator() method seems to do is to set a reference value for some kind of comparator. So it should be named setReference() or similar.
Alexander
|
---|