/** * Method to check if a token is common in a language. * * @param string $token The token to test. * @param string $lang The language to reference. * * @return boolean True if common, false otherwise. * * @since 2.5 */ public static function isCommon($token, $lang) { static $data; // Load the common tokens for the language if necessary. if (!isset($data[$lang])) { $data[$lang] = FinderIndexerHelper::getCommonWords($lang); } // Check if the token is in the common array. if (in_array($token, $data[$lang])) { return true; } else { return false; } }