original_string: public static function removeStopWords($string, $asString = false)
      {
          $delimiters = preg_quote(static::$delimiters, '/');
          $stopWords = explode(',', static::$stopWords);
  
          $result = array_map(function ($token) {
              return $token;
          }, array_filter(
              array_map(function ($t) {
                  return mb_strtolower($t, 'UTF-8');
              }, preg_split("/[\\s$delimiters]+/", $string, -1, PREG_SPLIT_NO_EMPTY)),
              function ($word) use ($stopWords) {
                  return !in_array($word, $stopWords);
              }
          ));
          if ($asString) {
              return implode(' ', $result);
          }
  
          return $result;
      }
code: public static function removeStopWords($string, $asString = false)
      {
          $delimiters = preg_quote(static::$delimiters, '/');
          $stopWords = explode(',', static::$stopWords);
  
          $result = array_map(function ($token) {
              return $token;
          }, array_filter(
              array_map(function ($t) {
                  return mb_strtolower($t, 'UTF-8');
              }, preg_split("/[\\s$delimiters]+/", $string, -1, PREG_SPLIT_NO_EMPTY)),
              function ($word) use ($stopWords) {
                  return !in_array($word, $stopWords);
              }
          ));
          if ($asString) {
              return implode(' ', $result);
          }
  
          return $result;
      }
code_tokens: public static function removeStopWords ( $ string , $ asString = false ) { $ delimiters = preg_quote ( static :: $ delimiters , '/' ) ; $ stopWords = explode ( ',' , static :: $ stopWords ) ; $ result = array_map ( function ( $ token ) { return $ token ; } , array_filter ( array_map ( function ( $ t ) { return mb_strtolower ( $ t , 'UTF-8' ) ; } , preg_split ( "/[\\s$delimiters]+/" , $ string , - 1 , PREG_SPLIT_NO_EMPTY ) ) , function ( $ word ) use ( $ stopWords ) { return ! in_array ( $ word , $ stopWords ) ; } ) ) ; if ( $ asString ) { return implode ( ' ' , $ result ) ; } return $ result ; }
docstring: Remove stop words
  
  @param $string
  @param bool $asString
  
  @return array|string
docstring_tokens: Remove stop words