<commit_before><?php

namespace Wilson;

use Exception;
use Wilson\UrbanWords;

class Crud
{
    /**
     * This function adds a new word or entry to the data array in UrbanWords class
     * @param  array $newEntry. An array containing a word, its meaning, and example usage
     * @return array
     */
    public static function create($newEntry)
    {
        if(! is_array($newEntry) ) {
            throw new Exception('Error processing request. $newEntry is not an array.');
        }

        array_push(UrbanWords::$data, $newEntry);

        return $newEntry;
    }

    /**
     * This function reads the meaning and sample sentence of a single word in the data array in UrbanWords class
     * @return [type] [description]
     */
    public static function find($word)
    {
        $entry = [];
        $index = 0;

        foreach (UrbanWords::$data as $value) {
            if(strtolower($value["slang"]) == strtolower($word)) {
                $entry = UrbanWords::$data[$index];
                break;<commit_msg>Make correction to comment in Crud.php<commit_after><?php

namespace Wilson;

use Exception;
use Wilson\UrbanWords;

class Crud
{
    /**
     * This function adds a new word or entry to the data array in UrbanWords class
     * @param  array $newEntry. An array containing a word, its meaning, and example usage
     * @return array
     */
    public static function create($newEntry)
    {
        if(! is_array($newEntry) ) {
            throw new Exception('Error processing request. $newEntry is not an array.');
        }

        array_push(UrbanWords::$data, $newEntry);

        return $newEntry;
    }

    /**
     * This function reads the meaning and sample sentence of a single word in the data array in UrbanWords class
     * @return
     */
    public static function find($word)
    {
        $entry = [];
        $index = 0;

        foreach (UrbanWords::$data as $value) {
            if(strtolower($value["slang"]) == strtolower($word)) {
                $entry = UrbanWords::$data[$index];
                break;
{'fraction_non_alphanumeric': 0.10600193610842207, 'fraction_numerical': 0.000968054211035818, 'mean_word_length': 2.3072, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1010366', 'n_tokens_mistral': 589, 'n_tokens_neox': 565, 'n_words': 196}