Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 ASP Spellchecker
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 3

Karnage
Starting Member

United Kingdom
4 Posts

Posted - 19 April 2001 :  06:36:06  Show Profile  Send Karnage an ICQ Message
I'm currently in the final stages of completing my newsASP script. I'm wondering whether it would be ok to use the spellcheck code on the "preview news" page in my script?? I'm also looking at how to speed the script up as with 20+ news posts the server is hammered quite a lot and takes a while to process the data.

Could the person who wrote it please get in contact with me - thanks :)

-Jonathan
Go to Top of Page

cse42
Starting Member

4 Posts

Posted - 20 April 2001 :  07:32:35  Show Profile
quote:

A nice MOD I've been looking for this.
The sad thing is that it's SLOOOWWWW.....

Best regards,
Erik P. Ernst



I converted the dictionary to Access 2000 and created an Index(primary key) on the word. Those changes had a vast performance improvement. Even if you don't convert to Access 2000, adding the index helps. The trade off is, of course, disk space.

Hope that helps....

ps I also changed the connect string to:

"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("data/dictionary.mdb")

Instead of using the Jet ODBC... that always seems to speed things up a bit.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 20 April 2001 :  08:07:15  Show Profile  Visit HuwR's Homepage
quote:

quote:

A nice MOD I've been looking for this.
The sad thing is that it's SLOOOWWWW.....

Best regards,
Erik P. Ernst



I converted the dictionary to Access 2000 and created an Index(primary key) on the word. Those changes had a vast performance improvement. Even if you don't convert to Access 2000, adding the index helps. The trade off is, of course, disk space.

Hope that helps....

ps I also changed the connect string to:

"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("data/dictionary.mdb")

Instead of using the Jet ODBC... that always seems to speed things up a bit.



Adding an index is the best improvement you can make, but does increase the size somewhat.

I ran the following tests on a 5500 word post

Access 97 db using Jet4 66 secs
Access 2000 using Jet4 55 secs

Access97 using 97 driver 67 secs
Access2000 using 97 driver 55 secs

Indexed Acc2000 using Jet4 3 secs
Indexed Acc2000 using 97 3 secs

Indexed Acc97 using Jet4 3 secs
Indexed Acc97 using 97 3 secs

From these, the driver would not appear to affect the speed.

Go to Top of Page

MisterVB
Junior Member

274 Posts

Posted - 20 April 2001 :  08:36:08  Show Profile  Visit MisterVB's Homepage
hey i don't have this line in my inc_top.asp

function openpollWindow(url) {
popupWin = window.open(url,'new_page','width=300,height=400')
}

Go to Top of Page

cse42
Starting Member

4 Posts

Posted - 20 April 2001 :  12:16:20  Show Profile
quote:

....
Adding an index is the best improvement you can make, but does increase the size somewhat.

I ran the following tests on a 5500 word post

Access 97 db using Jet4 66 secs
Access 2000 using Jet4 55 secs

Access97 using 97 driver 67 secs
Access2000 using 97 driver 55 secs

Indexed Acc2000 using Jet4 3 secs
Indexed Acc2000 using 97 3 secs

Indexed Acc97 using Jet4 3 secs
Indexed Acc97 using 97 3 secs

From these, the driver would not appear to affect the speed.




I'll qualify the driver speed. I'm using the Access 2000/Windows 2000 drivers not Access 97. On average the performance gain is measured only in fractions of milli-secs. Sorry for the confusion...
Go to Top of Page

Capt_Dunzell
Junior Member

USA
160 Posts

Posted - 23 April 2001 :  20:21:22  Show Profile  Visit Capt_Dunzell's Homepage
How do I create the index that you are talking about?

I would love to have the mod speed up a bit.

http://www.dunzellsden.com/forum/
Go to Top of Page

Karnage
Starting Member

United Kingdom
4 Posts

Posted - 24 April 2001 :  09:53:45  Show Profile  Send Karnage an ICQ Message
Could somebody please give me the contact details of the creator of this excellent mod. I'd like to ask their permission to use it in my news script before making my script available to the public. Full credit will be given to the creator.

Thanks in advance. :)

Go to Top of Page

cse42
Starting Member

4 Posts

Posted - 24 April 2001 :  11:44:21  Show Profile
quote:

How do I create the index that you are talking about?

I would love to have the mod speed up a bit.

http://www.dunzellsden.com/forum/


Piece of pie, easy as cake...
Open the database.. (the one that came with the mod)
Open the 'dictionary' table in design view..
Select the field 'word'
-At the bottom of the view is a tab named 'General'. One of the design fields is named 'Indexed'
Select the design field 'Indexed' -you should get a drop down that lists:
No
Yes (Duplicates Ok)
Yes (No Duplicates)

Select 'Yes (No Duplicates)'
Close the table
Answer Yes to save changes
Close the database

Just remember, indexing will cost you disk space...

Best o'l Luck
cse


Go to Top of Page

Capt_Dunzell
Junior Member

USA
160 Posts

Posted - 24 April 2001 :  13:00:12  Show Profile  Visit Capt_Dunzell's Homepage
Thanks, worked like a charm.

Didnt make it too much bigger, still under 4 megs.

http://www.dunzellsden.com/forum/
Go to Top of Page

Adul
Starting Member

37 Posts

Posted - 21 June 2001 :  23:36:08  Show Profile  Visit Adul's Homepage  Send Adul an AOL message  Send Adul an ICQ Message
yes finaly! I can stop using word!

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 22 June 2001 :  00:34:47  Show Profile  Visit HuwR's Homepage
quote:

Could somebody please give me the contact details of the creator of this excellent mod. I'd like to ask their permission to use it in my news script before making my script available to the public. Full credit will be given to the creator.

Thanks in advance. :)





The original code was from ASP101.com, it contained no reference as to who the original author was, I changed the code so that it used a database instead of a text file, and integrated it into Snitz.

Go to Top of Page

eleven
Starting Member

Turkey
32 Posts

Posted - 23 June 2001 :  00:50:35  Show Profile
Hi Huwr,

Is it possible to add new features to this Mod? For example:

* Add a new word (Admin page)
* Delete a word (Admin page)
* Suggestions: change to/change all

SpellChecker.Net has some of these features. Some boards like UBB use this site to add their board "spell check" function. But it is not free! And it is CGI

Thanks

Burak Tuyan aka eLeVeN

Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 23 June 2001 :  01:59:20  Show Profile
Spellchecker.net does work with this forum. They also do have an .asp version of the sproxy.cgi called sproxy.asp. But they have banners on the popup window, which alot of people don't like.

(The code for this was provided in a MOD by slemieux that eventually evolved into the Format buttons that we have today, just the spellchecker and the language translation part was left out because of the dependence on a third-party provider)

you can try it out HERE

What we were wanting was something that could be on our own server and didn't rely on another site. That's why HuwR wrote this MOD.
Go to Top of Page

Syedur
New Member

USA
93 Posts

Posted - 23 June 2001 :  03:12:48  Show Profile  Visit Syedur's Homepage  Send Syedur an AOL message  Send Syedur an ICQ Message  Send Syedur a Yahoo! Message
Here is a nice script you can use..
I am beginner with ASP things... so I can't really come to any help...
I was going to do it myself, then again, I don't know how to search for related words in the database according to the misspelled words...
<%@ Language=VBScript %>
<HTML>
<HEAD>
<script language="javascript">
function wrapup(formnum, elementnum){
var tmp1 = '';
var somecount = document.fixspell.thecount.value;
for(i=1;i<=somecount;i++){
if(document.fixspell.elements[i].type == 'select-one'){
tmp1 = document.fixspell.elements[i].options[document.fixspell.elements[i].selectedIndex].text;
tmpold = document.fixspell.elements[i].options[0].text;
if(tmp1 == tmpold){
}else{
if(document.fixspell.toconfirm.checked == true){
if(confirm('Change: ' + tmpold +' to '+ tmp1 + '?')){
window.opener.document.forms[formnum].elements[elementnum].value = window.opener.document.forms[formnum].elements[elementnum].value.replace(tmpold, tmp1);
}
}else{
window.opener.document.forms[formnum].elements[elementnum].value = window.opener.document.forms[formnum].elements[elementnum].value.replace(tmpold, tmp1);
}
}
}
}
window.close();
}
function closer(){
window.close();
}
</script>
</HEAD>
<BODY>
<BR><B><u>Original text. Misspelled words are in bold. </u></b><BR><BR>
<%
COMtexttocheck = ""
Set myspellobj = Server.CreateObject("spellcheck.clschecker")
myspellobj.usemsword=true
MyTextToCheck=Request("sometext")
myspellobj.texttocheck=MyTextToCheck
myspellobj.start
int mvar = 0
For x = 1 To myspellobj.cWords.Count
CheckedWord = myspellobj.cWords(x).word
iscorrect=myspellobj.cWords(x).iscorrect
if iscorrect = false then
mvar = mvar+1
MyTextToCheck=replace(MyTextToCheck,CheckedWord,"<b>" & CheckedWord & "</b>")
'Response.Write " <B>echo"&CheckedWord&"</B> "
else
'Response.Write " echo"&CheckedWord&" "
end if
Next
Response.Write "<font color=black>"&MyTextToCheck&"</font><BR><BR>"
%>
<br><hr>
<B>Correct each word here(or continue with your selection) and press Submit to contiune.</b><BR><BR>
<form name=fixspell>
<input type=hidden name=thecount value="<%=myspellobj.cWords.Count%>">
<%
if mvar <> 0 then
For x = 1 To myspellobj.cWords.Count
CheckedWord = myspellobj.cWords(x).word
iscorrect=myspellobj.cWords(x).iscorrect
if iscorrect = false then
Response.Write "<select name=word"&x&">"
Response.Write "<option selected>"&CheckedWord&"</option>"
if myspellobj.cWords(x).SuggestedWords.Count = 0 then
Response.Write "<option>No Suggestion</option>"
else
For s = 1 To myspellobj.cWords(x).SuggestedWords.Count
suggestedword=myspellobj.cWords(x).SuggestedWords(s).word
Response.Write "<option>"&suggestedword&"</option>"
Next
end if
Response.Write "</select>"
else
Response.Write "<input type=hidden name=word"&x&" value="&CheckedWord&">"
Response.Write " "&CheckedWord&" "
end if
Next
%>
<BR><BR><input type=button value="Save Changes" onclick="wrapup(<%=request("formnum")%>,<%=request("elementnum")%>);" id=button1 name=button1><BR>Confirm Changes?<input type=checkbox name=toconfirm checked>
<%else
Response.Write("<B>There are 0 words marked incorrect</b><BR><BR> ")
Response.Write("<input type=button value=""Close this window."" onclick=""closer();"">")
end if%>
</form>
</BODY>
</HTML>

See an example of this script...
http://mirrordns.com/products/spellchecker/examples/single.htm
I would love to help with this subject, let me know if I can come to any help. As far as I believe, this script is perfect, if it can be worked around with the database HuwR created, it just needs a little organizing.
My side is JavaScripts.
Thanks.


There is a time in every man’s education when he arrivers at the conviction that envy is ignorance; that imitation is suicide.

Edited by - Syedur on 23 June 2001 03:16:49
Go to Top of Page

Azaniah
Senior Member

United Kingdom
1004 Posts

Posted - 24 June 2001 :  14:03:13  Show Profile  Visit Azaniah's Homepage
Great mod

Two things however. If the strMessagePreview is empty and you try to check the spelling you get.

Error Type:
Microsoft JET Database Engine (0x80040E14)
In operator without () in query expression 'word in )'.
/test8/snitz/pop_spellcheck.asp, line 95


Browser Type:
Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Page:
GET /test8/snitz/pop_spellcheck.asp

The only other thing that would be "extremely nice to have" (and I'm trying to see if it possible but with my limited skills it's not likely) is something similiar to the above script that allows you to choose alternate spellings.

Cheers Az



-------
Eagles fly!, but weasels don't get sucked into jet engines.
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page | Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07