-
+ 94C95EA44C7EDBA16C996FDC7AB58F3AF0B2D8BC9DFC18C2C70D94A42427EC8F26ECCE67F73EE90C5D83B5BE955DDCBD9E809C6E71F2B1A3F9FA435A084D7F3E
mp-wp/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
(0 . 0)(1 . 66)
122448 <?php
122449 /**
122450 * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
122451 *
122452 * This class was contributed by Michel Weimerskirch.
122453 *
122454 * @package MCManager.includes
122455 * @author Moxiecode
122456 */
122457
122458 class EnchantSpell extends SpellChecker {
122459 /**
122460 * Spellchecks an array of words.
122461 *
122462 * @param String $lang Selected language code (like en_US or de_DE). Shortcodes like "en" and "de" work with enchant >= 1.4.1
122463 * @param Array $words Array of words to check.
122464 * @return Array of misspelled words.
122465 */
122466 function &checkWords($lang, $words) {
122467 $r = enchant_broker_init();
122468
122469 if (enchant_broker_dict_exists($r,$lang)) {
122470 $d = enchant_broker_request_dict($r, $lang);
122471
122472 $returnData = array();
122473 foreach($words as $key => $value) {
122474 $correct = enchant_dict_check($d, $value);
122475 if(!$correct) {
122476 $returnData[] = trim($value);
122477 }
122478 }
122479
122480 return $returnData;
122481 enchant_broker_free_dict($d);
122482 } else {
122483
122484 }
122485 enchant_broker_free($r);
122486 }
122487
122488 /**
122489 * Returns suggestions for a specific word.
122490 *
122491 * @param String $lang Selected language code (like en_US or de_DE). Shortcodes like "en" and "de" work with enchant >= 1.4.1
122492 * @param String $word Specific word to get suggestions for.
122493 * @return Array of suggestions for the specified word.
122494 */
122495 function &getSuggestions($lang, $word) {
122496 $r = enchant_broker_init();
122497 $suggs = array();
122498
122499 if (enchant_broker_dict_exists($r,$lang)) {
122500 $d = enchant_broker_request_dict($r, $lang);
122501 $suggs = enchant_dict_suggest($d, $word);
122502
122503 enchant_broker_free_dict($d);
122504 } else {
122505
122506 }
122507 enchant_broker_free($r);
122508
122509 return $suggs;
122510 }
122511 }
122512
122513 ?>