The easiest way for me to explain what I'm trying to do is show an example.
I have the following tables:
WORDS
WordID Word
1 1,000,000
2 a million
3 one million
WORDLINKS
WordID WordLinkID
1 2
1 3
2 1
2 3
3 1
3 2
I would then pass the following sentance into the SP
a million times a day
What the SP needs to do is parse the string and find all the phrases within that match the words in the WORDS table. It would then take the WordID and do a lookup in the WORDLINKS table to find all the possible alternatives/synonimes.
The result would be in the following form:
{a million|1,000,0 00|one million} times a day
the matched phrase has been wrapped in {} with each matched alternatives/synonimes seperated by a pipe |.
there would be multiple phrases in each input string and possibly nested words
eg in the example above the phrase 'one million', 'one' could have an alternative of '1' in which case the output would be:
{a million|1,000,0 00|{one|1} million} times a day
i hope this makes sense. any help would really be appreciated.
Thanks
Josh
I have the following tables:
WORDS
WordID Word
1 1,000,000
2 a million
3 one million
WORDLINKS
WordID WordLinkID
1 2
1 3
2 1
2 3
3 1
3 2
I would then pass the following sentance into the SP
a million times a day
What the SP needs to do is parse the string and find all the phrases within that match the words in the WORDS table. It would then take the WordID and do a lookup in the WORDLINKS table to find all the possible alternatives/synonimes.
The result would be in the following form:
{a million|1,000,0 00|one million} times a day
the matched phrase has been wrapped in {} with each matched alternatives/synonimes seperated by a pipe |.
there would be multiple phrases in each input string and possibly nested words
eg in the example above the phrase 'one million', 'one' could have an alternative of '1' in which case the output would be:
{a million|1,000,0 00|{one|1} million} times a day
i hope this makes sense. any help would really be appreciated.
Thanks
Josh
Comment