⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.72
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
psa-pear
/
pear
/
php
/
Horde
/
View File Name :
SpellChecker.php
* @author Michael Slusarz
* @category Horde * @copyright 2005-2016 Horde LLC * @license http://www.horde.org/licenses/lgpl21 LGPL 2.1 * @package SpellChecker */ abstract class Horde_SpellChecker { const SUGGEST_FAST = 1; const SUGGEST_NORMAL = 2; const SUGGEST_SLOW = 3; /** * Configuration parameters. * * @var array */ protected $_params = array( 'html' => false, 'locale' => 'en', 'localDict' => array(), 'maxSuggestions' => 10, 'minLength' => 3, 'suggestMode' => self::SUGGEST_FAST ); /** * Attempts to return a concrete Horde_SpellChecker instance based on * $driver. * * @deprecated * * @param string $driver The type of concrete subclass to return. * @param array $params A hash containing any additional configuration * or connection parameters a subclass might need. * * @return Horde_SpellChecker The newly created instance. * @throws Horde_Exception */ public static function factory($driver, $params = array()) { $class = 'Horde_SpellChecker_' . Horde_String::ucfirst(basename($driver)); if (class_exists($class)) { return new $class($params); } throw new Horde_Exception('Driver ' . $driver . ' not found'); } /** * Constructor. * * @param array $params TODO */ public function __construct(array $params = array()) { $this->setParams($params); } /** * Set configuration parmeters. * * @param array $params Parameters to set. */ public function setParams($params) { $this->_params = array_merge($this->_params, $params); } /** * Perform spellcheck. * * @param string $text Text to spellcheck. * * @return array TODO * @throws Horde_SpellChecker_Exception */ abstract public function spellCheck($text); /** * TODO * * @param string $text TODO * * @return array TODO */ protected function _getWords($text) { return array_keys(array_flip(preg_split('/[\s\[\]]+/s', $text, -1, PREG_SPLIT_NO_EMPTY))); } /** * Determine if a word exists in the local dictionary. * * @param string $word The word to check. * * @return boolean True if the word appears in the local dictionary. */ protected function _inLocalDictionary($word) { return empty($this->_params['localDict']) ? false : in_array(Horde_String::lower($word, true, 'UTF-8'), $this->_params['localDict']); } }