public function classify(array $classes, DocumentInterface $d)
    {
        $maxclass = current($classes);
        $maxvote = $this->getVote($maxclass,$d);
        while ($class = next($classes)) {
            $v = $this->getVote($class,$d);
            if ($v>$maxvote) {
                $maxclass = $class;
                $maxvote = $v;
            }
        }

        return $maxclass;
    }