News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Pspell problem

Started by jindroush, May 27, 2004, 08:55:00 AM

Previous topic - Next topic

jindroush

Hi,

I've got strange pspell problem. I've installed czech aspell dictionaries. Now it works almost as expected, it picks words, makes suggestions. So far so good.

But it picks _only_ parts of words or whole words without czech accented characters!

For example from word:

p ACCENT ACCENT ACCENT ern ACCENT

(příšerně)

it checks only that 'ern' part. Where may be the problem? Is it possible that it's somewhere around preg_match_all in Subs-Post.php ?

My settings:

$txt['lang_locale'] = 'cs_CZ';
$txt['lang_dictionary'] = 'cs';
$txt['lang_spelling'] = '';
$txt['lang_character_set'] = 'iso-8859-2';

[Unknown]

Try this... Subs-Post.php, find:

preg_match_all('/(?:<[^>]+>)|(?:\[[^ ][^\]]*\])|(?:&[^;\ ]+;)|(?<=^|[^A-Za-z\'])([A-Za-z\']+)/is', $mystr, $alphas, PREG_PATTERN_ORDER);

Replace:

preg_match_all('/(?:<[^>]+>)|(?:\[[^ ][^\]]*\])|(?<=^|[^A-Za-z\'])([A-Za-z\']+)/is', $mystr, $alphas, PREG_PATTERN_ORDER);

Does that make it work?

-[Unknown]

jindroush

[this message was written while trying several approaches, so it's a bit lengthty]

Nope, still the same. I'm not sure, this regexp complexity is far beyond my knowledge, but what are those alphabet matches? They won't catch accented characters, will they?

I've tried (senselessly, cause I really don't get the regexp) replacing them with \w or [:alpha:] but nothing.

I also don't know if the locale is set right in the very moment of doing preg_match_all, but if I got it right, it seems that setlocale is not called anywhere in the code (except for date printing).

Server's default locale is en_US.UTF-8, but for the forum localization should run on cs_CZ.

So, I tried this:

setlocale(LC_ALL, @$txt['lang_locale']);
preg_match_all('/(?:<[^>]+>)|(?:\[[^ ][^\]]*\])|(?<=^|[^[:alpha:]\'])([[:alpha:]\']+)/is', $mystr, $alphas, PREG_PATTERN_ORDER);


And it seems to work. I think the locale _must_ be set everywhere where are any string operations, because for example strtolower or such _won't_ work without correctly set locale.

Alisha

I have searched and search, maybe not as well as I should have, but I am looking to make the Spell Check feature work. Although, I only see people with problems and Fixes for the problems.

I know its not as simple as having your host turn it on, install it, and you click the check box. Because I have done that, and its not working! lol Is there a thread where I can read and learn how to install it or make it work? My says its on and working, I believe them, I have a quality host. (see my topic in HOSTS)

I would like to use this feature, but I have no idea where to start!

Thanks!

Jeff Lewis

Make a phpinfo file and post it so we can take a look.
Co-Founder of SMF

Alisha

Quote from: Jeff Lewis on June 26, 2004, 11:56:14 PM
Make a phpinfo file and post it so we can take a look.

Uhmmm ok I am being hosted, would I still be able to do this? If so, I will need to learn that also.

Jeff Lewis

Create a text file called phpinfo.php and in it just hae the following:

<?php
phpinfo
();
?>


Upload that to your site and then view it, post that URL here so we can look...
Co-Founder of SMF

Alisha

Quote from: Jeff Lewis on June 27, 2004, 12:03:47 AM
Create a text file called phpinfo.php and in it just hae the following:

<?php
phpinfo
();
?>


Upload that to your site and then view it, post that URL here so we can look...

Done: http://dancedancekc.com/phpinfo.php

Jeff Lewis

Just as I thought, pspell ISN'T enabled on that server.
Co-Founder of SMF

Alisha

QuoteSorry, I see that. I just finished Chewing out support! I guess one mess up in over 18 months of flawless service isn't bad!

They had advised me that its was installed. They have never made this error before. I would hope that they won't again!

Ok, Now I received this Email tonight:

QuoteI'm sorry about the confusion. You will need to install PSPell into your
home directory, from where it can be referenced by your PHP scripts.

It was too late to call so I have credited your call-back request to your
account.

Let us know if you have any more questions.

Thanks!
Andrea

I am soooo Confused now... lol  I need to compile PHP on my sites root? *sigh*  I think I have discovered that I need a PHP Expert with a HS education that can speak Moron.  Because, maybe I am wrong, chances are I am, but my path is /home/.cadence/msalisha/dancedancekc.com  now is the talking /home/  a the home where I need to install this? Or is he talking my sites ROOT as my "Home" where I need to install this? What do I need to install?  I was talking with someone in PMs last night, about this, and they said I just need to upload pspell.php into the theme Dir. I do not have a pspell.php in default or anywhere that I could find? I did find a PSpell.js, I uploaded that into both theme and default. 

Anyway, thanks to everyone that has tried to help! :) If someone has some extra time, and they could translate a detailed explanation on what is going on, ect I would most greatfull, but please I need simple terms. I am still learning. Although, I did order a PHP handbook, and looking to find a PHP for Dummies! :)

Ben_S

Going off the email from your host, they don't know what they are talking about, unless you are on a VPS (which is unlikely, you would know if you were), you cannot install apspell and recompile php with pspell support.
Liverpool FC Forum with 14 million+ posts.

Alisha

Quote from: Alisha on June 28, 2004, 02:07:51 PM
Quote from: Ben_S on June 28, 2004, 11:19:13 AM
Going off the email from your host, they don't know what they are talking about, unless you are on a VPS (which is unlikely, you would know if you were), you cannot install apspell and recompile php with pspell support.

I wouldn't think so. Also, if I could or should of done this, I know I would have seen something about that in here before!

Ok... I spent a bit of time on the phone with one of the lead support Techs. Its turned out that they have NO idea how to explain things in Alisha terms.  :)

The way that dreamhost works, they have the severs configured so that I can install my own copy of PHP in my Root / home directory. This is to allow users to configure PHP and compile it with what ever they desire. This eliminates the possibility of a unstable flag or add on from knocking out 30 sites on that server. All security issues are directed at my sites only. This make sense to me now that I understand what he is talking about. Although, this leave me back at Square one! I have no PSpell, and no idea how to install PHP. Well I downloaded it, to look at, and I can't even unzip it! I am understanding that it is a 20 min install with a few UNIX commands.

So thats where I sit on this right now. Anyone intrested in installing PhP?? lol  I am sure one day I will get around to figuring out how to unzip it, install it, and have spell checker! I know I abuse that button on here!

Thanks to Everyone that took the time to help me out here! :) it is GREATLY Appreciated!  More than you will even know!

[Unknown]

I suggest you post in "Help Wanted"... for free.  More people will see it there, methinks.

-[Unknown]

Advertisement: