public function filterStopwords($string, $language)
    {
        $prepared = trim(strip_tags($string));

        if ($prepared === '') {
            return '';
        }

        $stopwords = array();
        $path = GC_DIR_PRIVATE . "/stopwords/$language.txt";

        if (is_readable($path)) {
            $stopwords = array_map('trim', file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
        }

        return implode(' ', array_diff(explode(' ', $prepared), $stopwords));
    }
public function filterStopwords($string, $language)
    {
        $prepared = trim(strip_tags($string));

        if ($prepared === '') {
            return '';
        }

        $stopwords = array();
        $path = GC_DIR_PRIVATE . "/stopwords/$language.txt";

        if (is_readable($path)) {
            $stopwords = array_map('trim', file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES));
        }

        return implode(' ', array_diff(explode(' ', $prepared), $stopwords));
    }
public function filterStopwords ( $ string , $ language ) { $ prepared = trim ( strip_tags ( $ string ) ) ; if ( $ prepared === '' ) { return '' ; } $ stopwords = array ( ) ; $ path = GC_DIR_PRIVATE . "/stopwords/$language.txt" ; if ( is_readable ( $ path ) ) { $ stopwords = array_map ( 'trim' , file ( $ path , FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ) ) ; } return implode ( ' ' , array_diff ( explode ( ' ' , $ prepared ) , $ stopwords ) ) ; }
Filters out stop-words for a given language
@param string $string
@param string $language
@return string
Filters out stop - words for a given language