The Little Guy Posted October 23, 2008 Share Posted October 23, 2008 Can I set pspell so it recognizes upper and lower case letters equally? Link to comment https://forums.phpfreaks.com/topic/129699-pspell/ Share on other sites More sharing options...
The Little Guy Posted October 23, 2008 Author Share Posted October 23, 2008 Anyone? Link to comment https://forums.phpfreaks.com/topic/129699-pspell/#findComment-673151 Share on other sites More sharing options...
discomatt Posted October 23, 2008 Share Posted October 23, 2008 Say what? <pre><?php $res = pspell_new('en'); $words = array('Hello', 'hello', 'HELLO'); foreach( $words as $word ) { if( pspell_check($res, $word) ) echo "$word is spelled correctly\n"; else echo "$word is spelled incorrectly\n"; } ?></pre> Outputs Hello is spelled correctly hello is spelled correctly HELLO is spelled correctly Link to comment https://forums.phpfreaks.com/topic/129699-pspell/#findComment-673170 Share on other sites More sharing options...
The Little Guy Posted October 23, 2008 Author Share Posted October 23, 2008 that works, I know, but not on a persons name. Example: http://dudeel.com/test Link to comment https://forums.phpfreaks.com/topic/129699-pspell/#findComment-673215 Share on other sites More sharing options...
discomatt Posted October 24, 2008 Share Posted October 24, 2008 Well, technically a proper noun starts with a capital letter... so it is spelled incorrectly. This little hack should work though... <pre><?php $res = pspell_new('en'); $words = array('ryan', 'taylor', 'bob', 'shoe'); foreach( $words as $word ) { if( pspell_check($res, ucfirst($word)) ) echo "$word is spelled correctly\n"; else echo "$word is spelled incorrectly\n"; } ?></pre> Link to comment https://forums.phpfreaks.com/topic/129699-pspell/#findComment-673715 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.