Function to get KeyWords from the database

Luthius

Active Member
Joined
Apr 5, 2011
Messages
324
Guys,
Is there a way we can create a function that get all the nouns (keywords) from a database and can store these non-repeteable nouns in a table creating something like a dictionary?

Nouns not verbs or prepositions or vowels. If the sentence has verbs or vowels it will capture only the nouns.
It will work like the Tag Cloud function we have on this forum, that captures the keywords...
 
Last edited:

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I don't get what vowels has to do with nouns or verbs. Plenty of nouns have vowels in them. Consonants too.
And where are these nouns to be found? Table data? Query sql? Code? Form/report labels?
AFAIK, you can only search for specific words in a string (be that table data, table names, whatever) as long as you supply that word as the word to search for. To do that, you'd need a list of nouns to look for. Expect any search to take a VERY long time.
 
Last edited:
Upvote 0
Sorry related to vowels - I was in a hurry and put it wrongly - :rolleyes:
Well, will be a function so I can use it in any table of my database.
The good example we have in here on our forum that easily identifies "tags" on any thread. Check the bottom section.
I want some function like that to implement in my database.
 
Upvote 0
What you are describing isn't really what Access is good at. I don't know of any already made functions for this. Generally, having a lot of tables that all have lot of fields that all have a lot of random text is not a relational design. What you are describing is basically unstructured data.
 
Upvote 0
I created a table called tblKeyWords where there is a text field called strKeyWord. I would like assistance from you guys on how to before insert the word check if the word exists in my tblKeyWords table.


Code:
Public Function GetWord(strInput As String) As Variant

    Dim strSpecialChars As String
    Dim i As Long
    Dim counter As Integer
    Dim strArray() As String
    
    ' Define chars to strip
    strSpecialChars = ",-""()*.:@!"
    
    ' First pass (char at a time), remove special chars
    For i = 1 To Len(strSpecialChars)
        strInput = Replace$(strInput, Mid$(strSpecialChars, i, 1), "")
    Next


    
    ' Return result
    strArray = Split(strInput, " ")
    For counter = 0 To UBound(strArray)
       'Check if the word exists on my table, if not insert the word strArray(counter)
    Next
    
End Function
 
Last edited:
Upvote 0
Searching on internet I found something called Parts-Of-Speech and our Microsoft has some API already created using Ms Word.

Scratching here and there I could develop the function below

Code:
Public Function PartOfSpeechVerification(strWordToBeVerified As String) As Boolean'Reference Microsoft Word XX Application
Dim objWord As Word.Application
Dim wordSynInfo As Word.SynonymInfo


Set wordSynInfo = SynonymInfo(strWordToBeVerified, LanguageID:=wdEnglishUS)


PartOfSpeechVerification = (wordSynInfo.MeaningCount > 0)


Set wordSynInfo = Nothing
Set objWord = Nothing
End Function

The problem now is the following

Check the existence of the word on my table tblKeyWords without create the error 5824 (Insufficient memory) due the lot of back and foward in the code (check if it is part of SynonymInfo list and exists or not in my tblKeyWords table).
 
Upvote 0
> I created a table called tblKeyWords where there is a text field called strKeyWord. I would like assistance from you guys on how to before insert the word check if the word exists in my tblKeyWords table

just go to the table design for
tblKeyWords and create a unique index on strKeyWord

any time someone tries to insert the same word access will pop up a message saying the word already exists

if you have a form doing the insert then you can catch the error number and display your own custom error message

I think that's the normal way of doing it

 
Upvote 0
The issue is the following
Check the existence of the word on my table tblKeyWords without create the error 5824 (Insufficient memory) due the lot of back and foward in the code (check if it is part of SynonymInfo list and exists or not in my tblKeyWords table).
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top