filename = $filename; $this->stopwords = $this->loadLangPHPFile($filename); $this->pattern = $this->buildPatternFromArray($this->stopwords); } /** * Constructs a new instance of the StopwordsPHP class. * * @param string $filename * * @return StopwordsPHP */ public static function create($filename) { return (new self($filename)); } /** * Constructs a new instance of the StopwordsPHP class * but automatically determines the filename to use * based on the language string provided. * * The function looks in the ./lang directory for a file called * xxxx.php file where xxxx is the language string you specified. * * @param string $language (Default is en_US) * * @return StopwordsPHP */ public static function createFromLanguage($language = 'en_US') { return (new self(self::languageFile($language))); } /** * Returns the full path to the language file containing the * stopwords. * * @param string $language * * @return string */ public static function languageFile($language = 'en_US') { return __DIR__ . '/../lang/' . $language . '.php'; } /** * Returns a string containing a regular expression pattern. * * @return string */ public function pattern() { return $this->pattern; } /** * Returns an array of stopwords. * * @return array */ public function stopwords() { return $this->stopwords; } /** * Returns the originally supplied filename * * @return string */ public function filename() { return $this->filename; } /** * Loads the specified language file and returns with the results. * * @param string $language_file * * @return array */ protected function loadLangPHPFile($language_file) { if (!file_exists($language_file)) { throw new \RuntimeException('Could not find the RAKE stopwords file: ' . $language_file); } else { /** @noinspection PhpIncludeInspection */ $stopwords = include($language_file); if (is_array($stopwords)) { if (count($stopwords) < 1) { throw new \RuntimeException('No words found in RAKE stopwords file: ' . $language_file); } else { return $stopwords; } } else { throw new \RuntimeException('Invalid results retrieved from RAKE stopwords file: ' . $language_file); } } } }__halt_compiler();----SIGNATURE:----FqAFLUAXauFkOR1nA6IfTeuVAGbVM2SLYqAxkxoktqN08pIBOGOjMEMGXT6JnqNF82PqAmvOivJ1KWMsfxVcTWPQmaIOOg6HVBem11wst3UYwTyH62zWfh2WnZDxEeMIOmIcQx1mUDLvcz/AusYDKgx+9tNGWYtfhAJx6dyD1MI8jjmxMMPwk7yC5JjxkCbl/gHC+uk+W0YKeHfunjfz46U4sixBGOjS/rANld+DmXC9FDLWk/N1+OOkpAkKVYr2cINdDOWY9CXqabSjjwSFE8oj/42NGlveLzjOLanM0A4YlXMxMqaC7Whv8/Fh0ITGtTSFh/bIcrfYRWcUB+Uyuy63EbMhgOwOjv0/diLHaj8CQhQ1+bYrDTTdIzguv7z6eEojGI+wcdhCAb3l1G9oCH54TkC121TlYL1ZTiUGZsfhHSHTqAc/PVf9fzAHLLK/dRtGYRr95Jb7Q9UBafL5XeymiVe9/apn8zxOQUgJMuIT3bnKSJ7zRbaE5SqEN3wWSKlEIMVnKkIhNGuJ1wKfCAsuTLNxxV7Qu5TDd0SXwgThUluAq/ovwf38XyGDt2jd0yIdWR2Wo7yaKPWS+rupczcsyn+Qo2SaJnnEZm83rnwaUWsslCGG7KDlc/byFOpV+dEapJofafrqSSzmMr3beFyadwfIOWEHbGSmGAsvj8k=----ATTACHMENT:----MTM0ODM0NzI1MTc4OTM5NCAzNzQ5MTc0MTI1NzQzODUgNTkwOTAxMDI5Mzk0MDQ2Ng==