[RC] PHPBB Spell Checker 1.06p - 09/20/05

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

V1.06p released!

See first post for details. :)

Nathan.
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

Post by Koyaanis »

Nathan_Anderson wrote: V1.06p released!

See first post for details. :)

Nathan.

Whups ... it no longer works in Opera 8.02. It's like the error I used to get when it couldn't find the word list data. I get the spell-check screen and header, but no spell-check features or echoed text to check.


But, about this:
Nathan_Anderson wrote: The easist way would be to use the phpbb module, and then in the spell ENGLISH file, change the $DB_TableName from:

Code: Select all

 $DB_TableName=$table_prefix."spelling_words"; 
to:

Code: Select all

  $DB_TableName='yourdatbaasename.spelling_words';
Assuming that your new spelling_words table does NOT have a prefix.

Nathan.


THANKS! I'll do that. But my silly server insists on putting a prefix on all my SQL databases using a MYDOMAIN_COM_- format. :-( So I presume I'll have to put something else in front of that, in some format. I'll hunt around in the code to see if there's another place to put the prefix. (I sure wish I knew php and java programming....)
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

Re: Dictionary in Separate Database

Post by Koyaanis »

robert_b wrote:
Koyaanis wrote:Problem: The dictionary word list was getting added to my normal phpBB database. That's all fine and well, but I didn't like having an extra 10+ megs of data to back-up every time I did a full phpBB SQL database back-up.

I like this idea and will give it a try to install as "Native MySQL" as well because I'm going to use phpSpell for some other things such as forms and would just as soon it reside in its own database.

For what it's worth, if you back up phpBB from within the Admin, it won't back up the speller table. It only backs up the tables that originally come with phpBB as far as I can tell.


I installed another mod that has the option to do a true global phpBB backup without having to type in lots of add-on tables. Since I have tons of mods installed, with tons of new tables, it makes it easier to just select 1 other options in my ACP's backup settings. So ... this is why I really needed to move the words-list out of there. Plus, as you say, now you can call it up for any other things on your web-space without having to make a completely different install of it. :-)
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

Koyaanis wrote:
Nathan_Anderson wrote:V1.06p released!

See first post for details. :)

Nathan.

Whups ... it no longer works in Opera 8.02. It's like the error I used to get when it couldn't find the word list data. I get the spell-check screen and header, but no spell-check features or echoed text to check.


But, about this:
Nathan_Anderson wrote: The easist way would be to use the phpbb module, and then in the spell ENGLISH file, change the $DB_TableName from:

Code: Select all

 $DB_TableName=$table_prefix."spelling_words"; 
to:

Code: Select all

  $DB_TableName='yourdatbaasename.spelling_words';
Assuming that your new spelling_words table does NOT have a prefix.

Nathan.


THANKS! I'll do that. But my silly server insists on putting a prefix on all my SQL databases using a MYDOMAIN_COM_- format. :-( So I presume I'll have to put something else in front of that, in some format. I'll hunt around in the code to see if there's another place to put the prefix. (I sure wish I knew php and java programming....)


Actually it should be quite simple. If you have already created the DB and the table. Then it is $DB_TableName = "<<YOURDATABASENAME>>.<<YOURSPELLINGTABLENAME>>"

Thats all there is to it. You need the DB name, a PERIOD then the Table name and you will be fine. :)


Nathan.
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

Post by Koyaanis »

Nathan_Anderson wrote: Actually it should be quite simple. If you have already created the DB and the table. Then it is $DB_TableName = "<<YOURDATABASENAME>>.<<YOURSPELLINGTABLENAME>>"

Thats all there is to it. You need the DB name, a PERIOD then the Table name and you will be fine. :)


Thanks!
(If I keep this up, I might be a programmer one day. Reading all this code for the past 4 weeks, installing new mods, finding where the edits are supposed to go when the original code has been changed from the install instructions in an older mod, etc., ... and it's starting to make sense to me -- but just barely. :-) )
TheYoMan
Registered User
Posts: 19
Joined: Sat Mar 12, 2005 12:41 am

Post by TheYoMan »

Nathan_Anderson wrote: You need to create a spell_french.php;

Nathan.


Hello,

I don't succes in creating the "spell_french.php" file :(
I don't understand how it work.

Is there a good "spell_french.php" file to download anywhere ?
Wxman
Registered User
Posts: 58
Joined: Mon Feb 21, 2005 5:49 pm
Location: New Hampshire
Contact:

Post by Wxman »

I have installed this mod and when I enter Spellchecking in the ACP, it gives me a runtime error on Line 0: "sfmform" is undefined. Also, at the top of the screen, it says that it is in Safe Mode.

Any suggestion on what to do to fix this?
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

Wxman wrote: I have installed this mod and when I enter Spellchecking in the ACP, it gives me a runtime error on Line 0: "sfmform" is undefined. Also, at the top of the screen, it says that it is in Safe Mode.

Any suggestion on what to do to fix this?


Actually the javascipt error is normal on some browsers. I haven't bothered to fix it in the admin since it is typically a one time use program, and my time on the spell check is much better spent on the actual program than the admin screen...

Being in safe mode also is not a problem. It just means that the script will import groups of words rather than the whole list at one time.

No fixes are needed for you. :)

Nathan.
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

TheYoMan wrote:
Nathan_Anderson wrote:You need to create a spell_french.php;

Nathan.


Hello,

I don't succes in creating the "spell_french.php" file :(
I don't understand how it work.

Is there a good "spell_french.php" file to download anywhere ?


If I had an spell_french, it would have been included in the distribution. But no one has donated one to the cause...

You basically have to copy spell_language.php to spell_French.php then add the letter that french uses to the valid letter array, and then add any common words to the common word array. (For instance in english, a, the, you, it, are common words)...

Nathan.
TheYoMan
Registered User
Posts: 19
Joined: Sat Mar 12, 2005 12:41 am

Post by TheYoMan »

Well, I done a spell_French.php file.

This is the listing :

Code: Select all

<?php
  // --------------------------------------------------------------------
  // phpSpell Language Template
  //
  // This is (c)Copyright 2002, 2003, Team phpSpell.
  // --------------------------------------------------------------------

  // --------------------------
  // Table Name
  // --------------------------
  $DB_TableName=$table_prefix."spelling_words";

  // Language Text
  $Language_Text = array('%d mots scanné.    %d mots à cooriger.');
  $Language_Javascript = array('Verifie le document...','Aucune erreur trouvée','OK','Annuler','Verification orthographique terminé','Correct','All','Ignore','Learn','Suggest','Definition','Thesaurus','Word correction','No Suggestions');

  // Prefix Database name for MSSQL tables
//  if ($dbms == "mssql") {
//    $DB_TableName = $dbname.".".$DB_TableName;
//  }

  // ---------------------------------------
  // PSPELL Support - Use English Dictionary
  // ---------------------------------------
  $Spell_Config["PSPELL_LANGUAGE"] = "fr";
  // --------------------------------------------------------------------
  // Example translation table:
  //     $Translation_Table = array("À", "Æ", "Ç");
  //     $Replacement_Table = array("a", "an", "sth");
  //     $Language_Translation_Character_List = "ÀÆÇ";
  // --------------------------------------------------------------------
  // for every "À" it finds in a word it will replace it with a "a"
  // for every "Ç" it finds it will replace it with a "sth"
  // for every "Æ" it finds it will replace it with a "an"
  // --------------------------------------------------------------------
  // Put the character(s) to be translated into the Translation_Table
  // Put the replacement character(s) into the replacement table
  // --------------------------------------------------------------------
  // The replacement string should be equivelent to the ENGLISH PHONETIC
  // sound.  So if you were to take a word with "À" in it; how would you
  // phonetically spell the word in english.  If the "À" sounds like a "A"
  // in english then "A" would be the replacement character.
  // If it sounds like "th" then you would use "th" as the characters.
  // always replace Larger groups first.  (i.e. if "ññ" sounds differently
  // than "ñ" then in the translation table you would have the "ññ" listed
  // before the "ñ".  So that way when it would replaced the "ññ" before it
  // replaced it twice with "ñ".
  // --------------------------------------------------------------------
  // Any letters you do not translate will be IGNORED for
  // when it attempts to find spelling matches!!!
  // --------------------------------------------------------------------
  $Translation_Table = array();
  $Replacement_Table = array();

// --------------------------------------------------------------------
// Put the list of valid characters in your language in this list
// --------------------------------------------------------------------
$Language_Character_List = "abcdefghijklmnopqrstuvwxyzâêîûôëïöüùéèçà'"; 
  $Language_Common_Words = ",le,la,un,une,des,du,ou,l',d',et,dans,dedans,ce,cette,plus,ce,ces,de,y,a,par,il,elle,je,tu,nous,vous,ils,elles,à,en,non,oui,pour,ton,mon,son,notre,votre,leur,leurs,ma,ta,sa,que,qu',moins,sur,avec,en,est,ai,ont,pas,faire,me,moi,toi,lui,cela,été,mais,lequel,laquel,lesquels,déjà,qui,que,quoi,dont,hors,ni,car,si,pouvoir,autre,c',même,n',à,ici";

  // --------------------------------------------------------------------
  // Translation function
  // --------------------------------------------------------------------
  function Translate_Word($Word) {
    return ($Word);
  }

  // --------------------------------------------------------------------
  // Phonetic work function
  // --------------------------------------------------------------------
  function Word_Sound_Function($Word) {
    return (metaphone($Word));
  }


  function Language_Decode(&$Data)
  {
    // MS Internet Explorer Hack -- IE sends utf8-unicode for upper (ascii 128+) characters
     if (strpos(@$_SERVER['HTTP_USER_AGENT'], 'MSIE') > 0 || strpos(@$_SERVER['ALL_HTTP'], 'MSIE') > 0) {
       if (function_exists('utf8_decode')) $Data = utf8_decode($Data);
     }
     return ($Data);
  }

  function Language_Encode(&$Data)
  {
    return ($Data);
  }

  function Language_Lower(&$Data)
  {
    return(strtolower($Data));
  }

  function Language_Upper(&$Data)
  {
    return(strtoupper($Data));
  }

?>
After, I had uploaded it on the "spelling" directory.
But, the French otption is still unavailable in list
Image


So when I load the french.dic , it is set for English :s

Image

What do I fail to do ?
Last edited by TheYoMan on Sun Sep 25, 2005 12:41 pm, edited 2 times in total.
Wxman
Registered User
Posts: 58
Joined: Mon Feb 21, 2005 5:49 pm
Location: New Hampshire
Contact:

Post by Wxman »

Thanks for the reply. The main thing I was concerned about this was that it only happened on one install of the software and not on the other (2 seperate boards). One install works flawless, the other gets the error I described. Both accessed using the same browser.

As long as it isn't a problem with its function, I'm a happy camper. :)
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

spell_French.php

Post by Koyaanis »

Thanks for that extra french spelling file! I don't know much about French or programming, but I was wondering something. I went online to find a list of all letters used in the French language, so shouldn't the line:

$Language_Character_List = "abcdefghijklmnopqrstuvwxyz'";

Look like this?

$Language_Character_List = "abcdefghijklmnopqrstuvwxyzàâçÇéÉèêëîïôùûü'";

With all the extra characters appended on it. (Are those extra capitalized letters needed in there, or are they redundant?)


p.s. As of last night I still couldn't get the demo of v1.06p to work with Opera v8.02, so I'll stick with v1.06o for now.
TheYoMan
Registered User
Posts: 19
Joined: Sat Mar 12, 2005 12:41 am

Post by TheYoMan »

TheYoMan wrote: Well, I done a spell_French.php file.
After, I had uploaded it on the "spelling" directory.
But, the French otption is still unavailable in list
Image


So when I load the french.dic , it is set for English :s

Image

What do I fail to do ?


Some news ?
Nathan_Anderson
Registered User
Posts: 755
Joined: Tue Mar 19, 2002 5:04 pm
Contact:

Post by Nathan_Anderson »

TheYoMan wrote:
TheYoMan wrote:Well, I done a spell_French.php file.
After, I had uploaded it on the "spelling" directory.
But, the French otption is still unavailable in list
Image


So when I load the french.dic , it is set for English :s

Image

What do I fail to do ?


Some news ?


Did you add "French" into the available languages array in the spell config?

Nathan.
Koyaanis
Registered User
Posts: 74
Joined: Sun Sep 04, 2005 3:05 pm

Post by Koyaanis »

Ooops... I made an error on reporting that v1.06p wouldn't work with my Opera.

Seems the times I went to check out the demo of v1.06p, that I had already used v1.06o on my own phoBB, and the java files were being held in my cache. So, when I'd go to check out the demo of v1.06p, it was relying on the cached java files on my own computer, not the new ones from your system. And that caused the error I was seeing.

Flushed out my cache, checked out the demo, and it all worked well. Installed the update to my own board and all's fine!

Sorry about reporting I was getting an error.
Locked

Return to “[2.0.x] MODs in Development”