<commit_before><?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

class Search_ResultSet_FacetFilter
{
	private $facet;
	private $data;

	function __construct(Search_Query_Facet_Interface $facet, array $data)
	{
		$this->facet = $facet;
		$this->data = $data;
	}

	function isFacet(Search_Query_Facet_Interface $facet)
	{
		return $this->facet->getName() === $facet->getName();
	}

	function getName()
	{
		return $this->facet->getName();
	}

	function getLabel()
	{
		return $this->facet->getLabel();
	}

	function getOperator()
	{
		return $this->facet->getOperator();
	}

	function getOptions()
	{
		$out = array();

		foreach ($this->data as $entry) {
			$out[$entry['value']] = tr('%0 (%1)', $this->facet->render($entry['value']), $entry['count']);
		}
		<commit_msg>[FIX] search: Translate facet labels<commit_after><?php
// (c) Copyright 2002-2013 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$

class Search_ResultSet_FacetFilter
{
	private $facet;
	private $data;

	function __construct(Search_Query_Facet_Interface $facet, array $data)
	{
		$this->facet = $facet;
		$this->data = $data;
	}

	function isFacet(Search_Query_Facet_Interface $facet)
	{
		return $this->facet->getName() === $facet->getName();
	}

	function getName()
	{
		return $this->facet->getName();
	}

	function getLabel()
	{
		return $this->facet->getLabel();
	}

	function getOperator()
	{
		return $this->facet->getOperator();
	}

	function getOptions()
	{
		$out = array();

		foreach ($this->data as $entry) {
			$out[$entry['value']] = tr('%0 (%1)', tra($this->facet->render($entry['value'])), $entry['count']);
		}
		
{'fraction_non_alphanumeric': 0.16217564870259482, 'fraction_numerical': 0.00998003992015968, 'mean_word_length': 4.207792207792208, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5551446', 'n_tokens_mistral': 743, 'n_tokens_neox': 679, 'n_words': 174}