Page 1 of 1

SQL with Word Forms

Posted: Wed Jul 17, 2002 4:44 pm
by dao
Hi,

I have this setup:

in the HTML table, I have very short documents with words and phrases like the following

Document 1 Body: adapt
Document 2 Body: adaptation
Document 3 Body: Adaptive controllers
...

I want to read in a word like "adaptive" and then use the wordforms capability of metamorph to find all documents that contain *only* variants of adaptive.

That means, from the table above, I only want to find document 1 and 2, since they contain *only* variants of my query? Document 3 contains the variant but it also contains other words.

If I use the following select statement, I get back all three documents:

"Select Body from HTML where Body Like adaptive"

Is there a way to take advantage of the word forms processing yet limit to searches to Bodies that are exact matches of the variants?

Thanks

dao@mit.edu

SQL with Word Forms

Posted: Thu Jul 18, 2002 11:25 am
by mark
Are there any predictable constraints on the Body field? Such as will it always contain only keywords and never extra leading or trailing spaces or punctuation. Or is it random text?

SQL with Word Forms

Posted: Thu Jul 18, 2002 11:55 am
by John
One possible approach would be to do the query in both directions:

select Body from HTML where Body like 'adaptive' and 'adaptive' like Body;

which would be appropriate if the number of matches to the first part were relatively small.

SQL with Word Forms

Posted: Thu Jul 18, 2002 2:32 pm
by dao
Answer to Mark:

The content is predictably a keyword or keyphrase with no leading spaces or trailing space. There may be punctuations: commas, quotations and parentheses.

SQL with Word Forms

Posted: Thu Jul 18, 2002 2:52 pm
by dao
Answer to John,

Very cool possible solution. The matches to the first part is usually around 100 to 200.

SQL with Word Forms

Posted: Thu Jul 18, 2002 3:06 pm
by mark
My idea wouldn't work anyhow. John's idea should work pretty well.