2010-07-30 7 views

답변

4

대소 문자를 구분할 수없는 옵션이없는 것을 발견했습니다. PSPELL의 제안 기능은 항상 첫 번째 제안으로 잘못 대문자 단어의 정확한 대소 문자를 반환하는 것, 그래서 초기 맞춤법 검사가 실패하면 우리는이를 확인할 수 있습니다 : PHP 5.3.2에

<?php 

function pspell_icheck($dictionary_link, $word) { 
    return (pspell_check($dictionary_link, $word) || 
    strtolower(reset(pspell_suggest($dictionary_link, $word))) == strtolower($word)); 
} 

$dict = pspell_new('en'); 
$word = 'foo'; 
echo pspell_icheck($dict, $word); 

?> 

작품. 행복한 코딩 :)

0

쉬운 해결책이 있습니다. 그냥 다음과 같이하십시오 :

$word = ucfirst($word); //Always capitalize to avoid case sensitive error 
if (!pspell_check($dict, $word)) { 
    $suggestions = pspell_suggest($dictionary, $word); 
}