Hi snowman,
Yes, what you shown was correct. Except don't forget the concatenation symbols (ie. '+' or '&' )
stringvariableA = "Elvis Presley"
WHERE UPPER(Question) LIKE UPPER('%" + stringvariableA + "%')
Did you mean:
WHERE UPPER(Question) LIKE UPPER('% " & stringvariableA & "%')
That this is the same thing?
If I am correct in this matter no answer is needed. Thank you.
ynlogic0 = "Fred is my friend. Who is Fred?"
array3 = Split("Fred is my friend. Who is Fred?", ".", -1, vbTextCompare)
If Ubound(array3) = 2 Then
ynlogic1 = array3(0)
ynlogic2 = array3(1)
End If
I still need to be able to compare the 2 together, this would show intent between the 2. Of course in this particular case the word Fred is the intent.
I know I can use the alphabetical numerical only command and the remove extra words command to reduce the amount of words that are in the sentences. So I would have to use sub strings so I do not lose sentence structure.
That way the word (is,) would not be compared. And I know that you did mention before about a compare command but I don't remember if you were talking about array tables only.
I did not want to go into anything real elaborate, just find 2 or more words that were the same and if they were, then they would get saved in to the temporary table.
That way this small command structure, would not automatically just put 2 sentences into the temporary array table, with out the 2 sentences having something to do with each other.
Basically I know how to use the function subroutine That you showed me, but I was trying to avoid something that complex. But if I must, I must.
But I was thinking maybe by using your separation routine I could separate the questions into individual words and comparing the individual words with the 1st sentence?? Or something like that.
I also understand that there could be 2 sentences preceding the questions, such as: Fred is my friend. Fred lives in Los Angeles. Who is Fred?
So I would need to set it up so the question would compare the 2 sentences and if both sentences had the word Fred in them they would be joined back togather.
That way what would be put into the temporary array table would be question: WHO IS FRED answer: Fred is your friend. Fred lives in Los Angeles.
I know I would need to set this up after ultra Hal does all of the switching of the "I" to "you" to get a proper sentence structure.
I also know that if the 2nd sentence said he lives in Los Angeles. This can become tricky because 1st I would have to determine that the word Fred was a name.
That way I could make an exception for the word he/she. Man the more I keep thinking about this the more complicated I keep making it.
It's funny that a simple thing is turning into a nerve-racking dilemma, LOL, because I know that in real life no one would ever look at somebody and say:
Fred is my friend. He lives in Los Angeles. Who's Fred? LOL. If someone did that to me, I would just look at them and say: what? And of course if I didn't want to be polite about it, the words could become more flamboyant. LOL.
I made a small adjustment in your code I added a space after the (. )
ynlogic0 = "Fred is my friend. Who is Fred?"
array3 = Split("Fred is my friend. Who is Fred?", ". ", -1, vbTextCompare)
If Ubound(array3) = 2 Then
ynlogic1 = array3(0)
ynlogic2 = array3(1)
End If
so what I was thinking was maybe I could set it up with a for next loop to repeat the compare function.
1st I would need to remove the extra words and any symbol to reduce the size of the sentence and question, that way only the pertinent data with exist.
So I guess at this point the question would be:
is there a way to count the words in the question?
This would give me an algebra parameter for the for next loop.
After I have the a count for the amount of words that are in the question.
Then I would use your separation, split() command, to split the question down into individual words.
Then I could use the for next loop to change the array factor array2(i) which would be the individual words that was in the question.
And I guess somewhere in the middle of all of this I would need to determine if it was a name.
If it is a name then I would want to use the structure that would except he or she in the place of the name. But this might be too much to even bother with.
I was just thinking it would be a way to capture all of the data about Fred, but if all it did was capture the 1st one that says Fred is your friend then that would just be the reply.
If you think that this is getting more complicated doing it that way then it's worth I understand. So keeping it simple might be the best way to go.
here is a quick thought, maybe you could figure out a way to use what ultra Hal already does, I no ultra Hal looks to see if part of the sentence has a name and so maybe this information could be passed on without having to re-look it up.
But if nothing else, I could always use the replace() command structure once I know it is a name if the word he or she could be replaced with the word Fred.
It just seems nowadays everyone expects so much from ultra Hal without ever considering that you would never speak to another human in that manner.
Sincerely, and thank you very much for showing me how to separate a sentence I look forward to utilizing this information in the free will plug-in where necessary.
C load.