<commit_before><?php

namespace SpellingDictionary;

class Words {
	public function addWord() {
		$dbw = Database::getConnection( DB_MASTER );
		}

}<commit_msg>Insert the word submitted into the table<commit_after><?php

namespace SpellingDictionary;

class Words {
	static function addWord( $formData ) {
		// $user = $this->getUser();
		global $wgSpellingDictionaryDatabase;
		$dbw = wfGetDB( DB_MASTER, array(), $wgSpellingDictionaryDatabase );

		$user = "ABC";

		$values = array(
			'sd_word' => $formData['word'],
			'sd_language' => $formData['language'],
			'sd_user' => $user,
			'sd_timestamp' => $dbw->timestamp(),
		);

		$dbw->insert( 'spell_dict_word_list',
			$values,
			__METHOD__ );
			return true;
		// return 'Try again';
	}
}

{'fraction_non_alphanumeric': 0.15620827770360482, 'fraction_numerical': 0.0, 'mean_word_length': 4.39568345323741, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '6567891', 'n_tokens_mistral': 288, 'n_tokens_neox': 257, 'n_words': 56}