public function badWords()
    {
        $words = explode(' ', $this->text);

        return collect($this->dictionary)->filter(function ($value) use ($words) {
            if ($this->strict) {
                return str_contains(strtolower($this->text), strtolower($value['word']));
            }

            return in_array(strtolower($value['word']), $words);
        })->map(function ($value) {
            return [
                'language' => $value['language'],
                'word'     => strtolower($value['word']),
            ];
        })->toArray();
    }
public function badWords()
    {
        $words = explode(' ', $this->text);

        return collect($this->dictionary)->filter(function ($value) use ($words) {
            if ($this->strict) {
                return str_contains(strtolower($this->text), strtolower($value['word']));
            }

            return in_array(strtolower($value['word']), $words);
        })->map(function ($value) {
            return [
                'language' => $value['language'],
                'word'     => strtolower($value['word']),
            ];
        })->toArray();
    }
public function badWords ( ) { $ words = explode ( ' ' , $ this -> text ) ; return collect ( $ this -> dictionary ) -> filter ( function ( $ value ) use ( $ words ) { if ( $ this -> strict ) { return str_contains ( strtolower ( $ this -> text ) , strtolower ( $ value [ 'word' ] ) ) ; } return in_array ( strtolower ( $ value [ 'word' ] ) , $ words ) ; } ) -> map ( function ( $ value ) { return [ 'language' => $ value [ 'language' ] , 'word' => strtolower ( $ value [ 'word' ] ) , ] ; } ) -> toArray ( ) ; }
Return the bad words contained in the text.

@return array
Return the bad words contained in the text .