Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 simple spell checking algorithm

Author  Topic 

cobrak1980
Starting Member

3 Posts

Posted - 2005-06-09 : 20:47:19
Hi All,

I need some help with a simple spell check algorithm.

My problem is as follows:

I have two tables, misspelledTable, correctlyspelledTable. They both contain some phrases. I want to create a mapping from misspelledTable to correctlyspelledTable so that I have a new version of misspelled table in which all the rows of misspelledTable are correctlt spelled w.r.t. correctlyspelledTable.

Please advice me.

Thank you,
Nagu

raclede
Posting Yak Master

180 Posts

Posted - 2005-06-09 : 21:02:50
can you post some DLL ? I didn't bring my crystal ball today.

"If the automobile had followed the same development cycle as the computer, a Rolls-Royce would today cost $100, get a million miles per gallon, and explode once a year, killing everyone inside. "

raclede
Go to Top of Page

vivek.kumargupta
Starting Member

45 Posts

Posted - 2005-06-10 : 03:49:29
Ya you can do it .for eg u can use this script

declare @misspelled_table_new
(
@mispelledstring nvarchar(100),
@correct_spelled nvarchar(100),.....)

insert into @misspelled_table_new
select mispelledstring ,correct_spelled
from misspelledTable mt
inner join correctlyspelledTable ct on mt.stringid=ct.stringid

Hope this solves your problem... ????

Thanks,
Vivek
Go to Top of Page

cobrak1980
Starting Member

3 Posts

Posted - 2005-06-10 : 13:10:02
quote:
Originally posted by vivek.kumargupta

Ya you can do it .for eg u can use this script

declare @misspelled_table_new
(
@mispelledstring nvarchar(100),
@correct_spelled nvarchar(100),.....)

insert into @misspelled_table_new
select mispelledstring ,correct_spelled
from misspelledTable mt
inner join correctlyspelledTable ct on mt.stringid=ct.stringid

Hope this solves your problem... ????

Thanks,
Vivek



Hi Vivek,
Thank you for your reply. Can you explain where did this stringid came from.

Let me pour a little mor einkling on my problem. The misspelledTable has N number of rows which are misspelled when compared to correctly spelled M number of rows. I want to understand the logic in creating a new table correctedMisspelledTable such that each row in misspelledTable is spelled correct according to correctlyspelledTable. There are no string IDs associated with any table, though we can create them.

Thank you,
Nagu
Go to Top of Page

vivek.kumargupta
Starting Member

45 Posts

Posted - 2005-06-13 : 07:05:55
The stringid is actually the column that links the two tables in discussion together.

Thanks,
Vivek
Go to Top of Page

jhermiz

3564 Posts

Posted - 2005-06-13 : 08:14:22
How about posting the DDL for your current tables, how do they link fk / pk.



Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

vivek.kumargupta
Starting Member

45 Posts

Posted - 2005-06-13 : 08:40:09
ya that will help !!

Thanks,
Vivek
Go to Top of Page

cobrak1980
Starting Member

3 Posts

Posted - 2005-06-13 : 10:54:05
Hi,

I am not using any dll. I want to write a SQL squery which can do this.

Thank you,
Nagu
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-06-13 : 10:57:26
Jon asked you to post the table structure.
See here for more details
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -