<commit_before><?php

/**
 * Author: skuridin <<EMAIL>>
 * Date: Nov 11, 2014
 * Time: 13:59:16 PM
 * Format: http://book.cakephp.org/2.0/en/models.html
 */
App::uses('DiffbotModel', 'DiffbotSource.Model');

/**
 * DiffbotArticle Model
 * 
 * @package DiffbotSource
 */
class DiffbotArticle extends DiffbotModel {

	/**
	 * {@inheritdoc}
	 *
	 * @var string
	 */
	public $name = 'DiffbotArticle';

	/**
	 * {@inheritdoc}
	 *
	 * @var string
	 */
	public $useTable = 'article';

	/**
	 * Get description and status by link
	 * 
	 * @param string $link
	 * @param string $status 1 = ok, 2 = fail
	 * @return string
	 * @throws Exception
	 */
	public function getDescriptionByLink($link, &$status) {
		$result = $this->find('first', array(
			'conditions' => array(
				'url' => $link,
				'fields' => 'text'
			)
				)
		);

		if (empty($result)) {
			throw new Exception(__('Diffbot could not download page %s', $link));
		}

		$description = Hash::get((array)$result, "{$this->alias}.text");
		$status = !empty($description) ? 1 : 2;

		return $description;
	}

}
<commit_msg>fix phpdoc<commit_after><?php

/**
 * Author: skuridin <<EMAIL>>
 * Date: Nov 11, 2014
 * Time: 13:59:16 PM
 * Format: http://book.cakephp.org/2.0/en/models.html
 */
App::uses('DiffbotModel', 'DiffbotSource.Model');

/**
 * DiffbotArticle Model
 * 
 * @package DiffbotSource
 */
class DiffbotArticle extends DiffbotModel {

	/**
	 * {@inheritdoc}
	 *
	 * @var string
	 */
	public $name = 'DiffbotArticle';

	/**
	 * {@inheritdoc}
	 *
	 * @var string
	 */
	public $useTable = 'article';

	/**
	 * Get description and status by link
	 * 
	 * @param string $link
	 * @param int $status 1 = ok, 2 = fail
	 * @return string
	 * @throws Exception
	 */
	public function getDescriptionByLink($link, &$status) {
		$result = $this->find('first', array(
			'conditions' => array(
				'url' => $link,
				'fields' => 'text'
			)
				)
		);

		if (empty($result)) {
			throw new Exception(__('Diffbot could not download page %s', $link));
		}

		$description = Hash::get((array)$result, "{$this->alias}.text");
		$status = !empty($description) ? 1 : 2;

		return $description;
	}

}

{'fraction_non_alphanumeric': 0.18359739049394222, 'fraction_numerical': 0.016775396085740912, 'mean_word_length': 3.2263779527559056, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1843611', 'n_tokens_mistral': 850, 'n_tokens_neox': 720, 'n_words': 177}