<?php

declare(strict_types=1);

namespace App\Knowledge;

use App\Config\StopWordsConfig;

final readonly class StopWords
{
    public function __construct(
        private StopWordsConfig $config
    ) {
    }

    /**
     * @return string[]
     */
    public function getStopWords(): array
    {
        return $this->config->getStopWords();
    }

    public function isStopWord(string $word): bool
    {
        return in_array($word, $this->config->getStopWords(), true);
    }
}