<commit_before><?php
/**
 * @package plugins.reach
 * @subpackage Admin
 */
class Form_DictionariesSubForm extends ConfigureSubForm
{
	private $ignore = array('relatedObjects', 'type', 'gs');
	private $prefix = "Dictionary_";

	private $type;

	public function __construct($type)
	{
		$this->type = $type;
		parent::__construct();
	}

	public function init()
	{
		$this->setAttrib('id', 'frmDictionariesSubForm');
		$this->setMethod('post');
		$this->addDecorator('ViewScript', array(
			'viewScript' => 'dictionary-sub-form.phtml',
		));

		$obj = new $this->type();
		$this->addObjectProperties($obj, $this->ignore, $this->prefix);

	}

	public function isValid($data)
	{
		if(!$data['ReachProfileDictionaries'])
			return false;
		
		$jsonData = json_decode($data['ReachProfileDictionaries'], true);
		if(!$jsonData)
			return false;
		
		return true;
	}
}<commit_msg>Fix return values to match old logic<commit_after><?php
/**
 * @package plugins.reach
 * @subpackage Admin
 */
class Form_DictionariesSubForm extends ConfigureSubForm
{
	private $ignore = array('relatedObjects', 'type', 'gs');
	private $prefix = "Dictionary_";

	private $type;

	public function __construct($type)
	{
		$this->type = $type;
		parent::__construct();
	}

	public function init()
	{
		$this->setAttrib('id', 'frmDictionariesSubForm');
		$this->setMethod('post');
		$this->addDecorator('ViewScript', array(
			'viewScript' => 'dictionary-sub-form.phtml',
		));

		$obj = new $this->type();
		$this->addObjectProperties($obj, $this->ignore, $this->prefix);

	}

	public function isValid($data)
	{
		if(!$data['ReachProfileDictionaries'])
			return true;
		
		$jsonData = json_decode($data['ReachProfileDictionaries'], true);
		if(!empty($jsonData))
			return true;
		
		return false;
	}
}
{'fraction_non_alphanumeric': 0.17165443252399773, 'fraction_numerical': 0.0, 'mean_word_length': 4.887043189368771, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '6117', 'n_tokens_mistral': 650, 'n_tokens_neox': 582, 'n_words': 116}