<commit_before><div class="index">
	<h2>Freetext Import Results</h2>
	<p>Below you can see the attributes that are to be created based on the results of the free-text import. Make sure that the categories and the types are correct, often several options will be offered based on an inconclusive automatic resolution. </p>
	<?php 
		echo $this->Form->create('Attribute', array('url' => '/events/saveFreeText/' . $event_id));
		if ($isSiteAdmin) {
			echo $this->Form->input('force', array(
					'checked' => false,
					'label' => 'Proposals instead of attributes',
			));
		}
		echo $this->Form->input('JsonObject', array(
				'label' => false,
				'type' => 'text',
				'style' => 'display:none;',
				'value' => '',
		));
		echo $this->Form->end();
	?>
	<table class="table table-striped table-hover table-condensed">
		<tr>
				<th>Value</th>
				<th>Similar Attributes</th>
				<th>Category</th>
				<th>Type</th>
				<th>IDS<input type="checkbox" id="checkAll" style="margin:0px;margin-left:3px;"/></th>
				<th>Comment</th>
				<th>Actions</th>
		</tr>
		<?php
			$options = array();
			foreach ($resultArray as $k => $item):
		?>
		<tr id="row_<?php echo $k; ?>" class="freetext_row">
			<?php 
				echo $this->Form->input('Attribute' . $k . 'Save', array(
						'label' => false,
						'style' => 'display:none;',
						'value' => 1,
				));
				echo $this->Form->input('Attribute' . $k . 'Value', array(
						'label' => false,
						'type' => 'hidden',
						'value' => h($item['value']),
				));
			?>
			<td>
				<input type="hidden" id="<?php echo 'Attribute' . $k . 'Save'; ?>" value=1 >
				<div id="<?php echo 'Attribute' . $k . 'Value'; ?>"><?php echo h($item['value']); ?></div>
			</td>
			<td>
				<?php 
					foreach ($item['related'] as $relation):
						$popover = array(
							'Event ID' => $relation['Event']['id'],
							'Event Info' => $relation['Event']['info'],
							'Category' => $relation['Attribute']['category'],
							'Type' => $relation['Attribute']['type'],
							'Value' => $relation['Attribute']['value'],
							'Comment' => $relation['Attribute']['comment'],
						);
						$popoverHTML = '';
						foreach ($popover as $k => $popoverElement) {
							$popoverHTML .= '<span class=\'bold\'>' . $k . '</span>: <span class=\'blue bold\'>' . $popoverElement . '</span><br />';
						}
				?>
						<a href="<?php echo $baseurl; ?>/events/view/<?php echo h($relation['Event']['id']);?>" data-toggle="popover" title="Attribute details" data-content="<?php echo h($popoverHTML); ?>" data-trigger="hover"><?php echo h($relation['Event']['id']);?></a>
				<?php 
					endforeach;
					// Category/type: 
					$correlationPopover = array('<span>', );
				?>
			</td>
			<td class="short">
				<?php 
					if (!isset($item['category'])) {
						$default = array_search($defaultCategories[$item['default_type']], $typeCategoryMapping[$item['default_type']]);
					} else {
						$default = array_search($item['category'], $typeCategoryMapping[$item['default_type']]);
					}
				?><commit_msg>Fix to a new bug introduced with the freetext import tool<commit_after><div class="index">
	<h2>Freetext Import Results</h2>
	<p>Below you can see the attributes that are to be created based on the results of the free-text import. Make sure that the categories and the types are correct, often several options will be offered based on an inconclusive automatic resolution. </p>
	<?php 
		echo $this->Form->create('Attribute', array('url' => '/events/saveFreeText/' . $event_id));
		if ($isSiteAdmin) {
			echo $this->Form->input('force', array(
					'checked' => false,
					'label' => 'Proposals instead of attributes',
			));
		}
		echo $this->Form->input('JsonObject', array(
				'label' => false,
				'type' => 'text',
				'style' => 'display:none;',
				'value' => '',
		));
		echo $this->Form->end();
	?>
	<table class="table table-striped table-hover table-condensed">
		<tr>
				<th>Value</th>
				<th>Similar Attributes</th>
				<th>Category</th>
				<th>Type</th>
				<th>IDS<input type="checkbox" id="checkAll" style="margin:0px;margin-left:3px;"/></th>
				<th>Comment</th>
				<th>Actions</th>
		</tr>
		<?php
			$options = array();
			foreach ($resultArray as $k => $item):
		?>
		<tr id="row_<?php echo $k; ?>" class="freetext_row">
			<?php 
				echo $this->Form->input('Attribute' . $k . 'Save', array(
						'label' => false,
						'style' => 'display:none;',
						'value' => 1,
				));
				echo $this->Form->input('Attribute' . $k . 'Value', array(
						'label' => false,
						'type' => 'hidden',
						'value' => h($item['value']),
				));
			?>
			<td>
				<input type="hidden" id="<?php echo 'Attribute' . $k . 'Save'; ?>" value=1 >
				<div id="<?php echo 'Attribute' . $k . 'Value'; ?>"><?php echo h($item['value']); ?></div>
			</td>
			<td>
				<?php 
					foreach ($item['related'] as $relation):
						$popover = array(
							'Event ID' => $relation['Event']['id'],
							'Event Info' => $relation['Event']['info'],
							'Category' => $relation['Attribute']['category'],
							'Type' => $relation['Attribute']['type'],
							'Value' => $relation['Attribute']['value'],
							'Comment' => $relation['Attribute']['comment'],
						);
						$popoverHTML = '';
						foreach ($popover as $key => $popoverElement) {
							$popoverHTML .= '<span class=\'bold\'>' . $key . '</span>: <span class=\'blue bold\'>' . $popoverElement . '</span><br />';
						}
				?>
						<a href="<?php echo $baseurl; ?>/events/view/<?php echo h($relation['Event']['id']);?>" data-toggle="popover" title="Attribute details" data-content="<?php echo h($popoverHTML); ?>" data-trigger="hover"><?php echo h($relation['Event']['id']);?></a>
				<?php 
					endforeach;
					// Category/type: 
					$correlationPopover = array('<span>', );
				?>
			</td>
			<td class="short">
				<?php 
					if (!isset($item['category'])) {
						$default = array_search($defaultCategories[$item['default_type']], $typeCategoryMapping[$item['default_type']]);
					} else {
						$default = array_search($item['category'], $typeCategoryMapping[$item['default_type']]);
					}
				?>
{'fraction_non_alphanumeric': 0.22346002621231978, 'fraction_numerical': 0.001965923984272608, 'mean_word_length': 3.363831308077198, 'pattern_counts': {'":': 0, '<': 111, '<?xml version=': 0, '>': 177, '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': '3207549', 'n_tokens_mistral': 2489, 'n_tokens_neox': 1990, 'n_words': 456}