<commit_before><?php
	class Vocabulary extends MY_Controller
	{
		public function __construct()
		{
			parent::__construct();
			$this->force_to_login();
		}

		public function index()
		{
			$data = array();
			$data['words'] = $this->vocabulary_model->get_all();

			$this->load->view('vocabulary/vocablist', $this->common_data( $data ));  
		}

		public function add($word_id = null)
		{

			$data = array();
			$data['word']  = '';
			$data['word_form']  = '';
			$data['word_definition']  = '';

			if($word_id) 
			{
				$current_word = $this->vocabulary_model->get_by_id($word_id);
				$data['word'] =   $current_word->word;
				$data['word_form'] =   $current_word->form;
				$data['word_definition'] =   $current_word->definition;
				$new_word_id = $word_id;
			}


			if($_POST)
			{
				if($word_id)
				{

					$this->vocabulary_model->update($_POST['word'],$_POST['word_form'],$_POST['word_definition'],$word_id);
				}
				else
				{
					$new_word_id = $this->vocabulary_model->add($_POST['word'],$_POST['word_form'],$_POST['word_definition'],$this->current_user->user_id);


					$a = $this->facebook->api('/'.$this->config->item('group_id').'/feed','POST',array(    
						'message' => 'I have just added a new ' . $_POST['word_form'] . ' to our common knowledge. Check it and write your examples :)',
						'name' => $_POST['word'],
						'caption' => $_POST['word_form'],
						'description' => $_POST['word_definition'],
						'link' =>   site_url('vocabulary/view/' . $new_word_id)<commit_msg>points for adding word<commit_after><?php
	class Vocabulary extends MY_Controller
	{
		public function __construct()
		{
			parent::__construct();
			$this->force_to_login();
		}

		public function index()
		{
			$data = array();
			$data['words'] = $this->vocabulary_model->get_all();

			$this->load->view('vocabulary/vocablist', $this->common_data( $data ));  
		}

		public function add($word_id = null)
		{

			$data = array();
			$data['word']  = '';
			$data['word_form']  = '';
			$data['word_definition']  = '';

			if($word_id) 
			{
				$current_word = $this->vocabulary_model->get_by_id($word_id);
				$data['word'] =   $current_word->word;
				$data['word_form'] =   $current_word->form;
				$data['word_definition'] =   $current_word->definition;
				$new_word_id = $word_id;
			}


			if($_POST)
			{
				if($word_id)
				{

					$this->vocabulary_model->update($_POST['word'],$_POST['word_form'],$_POST['word_definition'],$word_id);
				}
				else
				{
					$new_word_id = $this->vocabulary_model->add($_POST['word'],$_POST['word_form'],$_POST['word_definition'],$this->current_user->user_id);

					$this->point_model->add($this->current_user->user_id,'word_'  . $new_word_id,"You have added a new word. +5",5,'vocabulary/view/' . $new_word_id);

					$a = $this->facebook->api('/'.$this->config->item('group_id').'/feed','POST',array(    
						'message' => 'I have just added a new ' . $_POST['word_form'] . ' to our common knowledge. Check it and write your examples :)',
						'name' => $_POST['word'],
						'caption' => $_POST['word_form'],
						'description' => $_POST['word_definition'],
						'link' =>   site_url('vocabulary/view/' . $new_word_id)
{'fraction_non_alphanumeric': 0.20401128172986524, 'fraction_numerical': 0.0006267627702914447, 'mean_word_length': 3.764179104477612, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 59, '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': '6524955', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1130, 'n_words': 161}