|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, April 05, 2009 9:28 PM
Points: 9,
Visits: 46
|
|
Hi All,
i need to find list of synonyms for a given string using sql server,is there a query to retrive list of synonyms for a given word ?
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, April 19, 2012 10:25 PM
Points: 1,231,
Visits: 3,483
|
|
HI,
Possible, when you create the table and store all the synonyms for the words
ARUN SAS
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, April 05, 2009 9:28 PM
Points: 9,
Visits: 46
|
|
Hi Arun ,
Thanks for ur reply, i need to find for (1000s of words) its not possible to find synonym for word by word and store it in a table ???? is it possible dynamically? for example like built in Function) if we give the word it should generate its list of synonym... guide the query for this???
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 10:41 AM
Points: 3,788,
Visits: 5,538
|
|
Kavi, could you give us an example of what you are trying to do? Some sample inputs and expected output would be most helpful.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller Stop, children, what's that sound? -- Stephen Stills
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, April 05, 2009 9:28 PM
Points: 9,
Visits: 46
|
|
Hi,
i have tried synonyms search with full text serach Thesaurus file, but it is needed to predefine the thesaurus file for each word, it is not feasible for me.So, i am looking for alternative option to find the synonyms search for the word.
For example: i need to find synonyms for any word for eg: the word "check" using sql query then the output should display all synonyms like the list below,
Try out test confirm ensure verify prove try
kindly help me with the query to execute this result...
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 10:41 AM
Points: 3,788,
Visits: 5,538
|
|
Kavi, such a query is simple, but you will still have to define the synonyms. You may be able to search the internet and find some sort of thesaurus file that you could download to populate a synonyms table in your database.
How do you plan to use this?
declare @synonyms table (rowID int identity (1,1), searchword varchar(20), synonymWord varchar(20) primary key (searchword,rowid) ) insert into @synonyms select 'check','try out' union all select 'check','test' union all select 'check','confirm' union all select 'check','ensure' union all select 'check','verify' union all select 'check','try' union all select 'check','prove'
--------------------------------- select synonymWord from @synonyms where searchword = 'check'
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller Stop, children, what's that sound? -- Stephen Stills
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Sunday, April 05, 2009 9:28 PM
Points: 9,
Visits: 46
|
|
Thanks Bob, Still i am trying to search for an pre-filled thesaurus file that defined synonym for all english words...so far not found,
so wat i tried with some alternate solution,but the query wic u gave doesnt suits me because for word by word i need to insert synonyms its very tedious to insert for whole dictionary ,is there any other way????
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, March 22, 2013 11:49 AM
Points: 945,
Visits: 998
|
|
kavi (3/30/2009) Hi All, i need to find list of synonyms for a given string using sql server,is there a query to retrive list of synonyms for a given word ? Kavi,
This is not a feature built into SQL Server. It's one you would have to create programmatically. I suggest you go grab a copy of an English Language Thesaurus from your library. If you really want to sit down and encode all of that, then feel free.
So no, there is no query to retrieve a list of synonyms for a given word. Not unless you build one.
|
|
|
|
|
Hall of Fame
       
Group: General Forum Members
Last Login: 2 days ago @ 10:41 AM
Points: 3,788,
Visits: 5,538
|
|
Kavi, if you are looking to build your own thesaurus file, you can certainly parse a string of synonyms this way, to make the population easier. This technique could be modified to translate an entire table. If you have questions about this, there are some good articles and forum posts already written under the headings PARSE and TALLY TABLE.
I hate to leave you now, but it's midnight here and I have to get some sleep. I'll check back in about nine hours.
I hope this helps.
declare @synonyms table (rowID int identity (1,1), searchword varchar(20), synonymWord varchar(20) primary key (searchword,rowid))
-------------------------------------------------------------- declare @synonym_list varchar(7900) declare @sepChar varchar(50) declare @element varchar(4) declare @searchword varchar(20) -------------------------------------------------------------- set @searchword = 'check' set @synonym_list = 'try out, test, examine, confirm, verify' set @sepchar = ',' set @synonym_list = @sepChar+@synonym_list+@sepChar -------------------------------------------------------------- ;WITH L0 AS (SELECT 1 AS C UNION ALL SELECT 1), --2 rows L1 AS (SELECT 1 AS C FROM L0 AS A, L0 AS B),--4 rows "L0 as A, L0 as B" is just shorthand way to code a cross join L2 AS (SELECT 1 AS C FROM L1 AS A, L1 AS B),--16 rows L3 AS (SELECT 1 AS C FROM L2 AS A, L2 AS B),--256 rows L4 AS (SELECT 1 AS C FROM L3 AS A, L3 AS B),--65536 rows Tally AS (SELECT TOP 1000 ROW_NUMBER() OVER(ORDER BY C) AS N FROM L4), syns AS (select Row_Number() over (order by N) as E, ltrim(rtrim(substring(@synonym_list,N+1,charindex(@sepChar,@synonym_list,N+1)-(N+1)))) as synWord from tally where substring(@synonym_list,N,1) = @sepChar and N < len(@synonym_list) ) -- insert into @synonyms select @searchword,synword from syns ---------------------------------------------- select * from @synonyms where searchword = 'check'
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller Stop, children, what's that sound? -- Stephen Stills
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Sunday, August 19, 2012 6:40 PM
Points: 202,
Visits: 301
|
|
|
|
|