I would like to create a database of words, where the word and part of speech is listed. Then, for simple examples, I would like to search a passage of text and identify the words' parts of speech based on the database.
Asked
Active
Viewed 55 times
-1
-
So are you saying you have different sayings in a database e.g. "fit as a fiddle" and you want to find this in a paragraph you provide from somewhere? Are you doing this in code or mysql? Do you want a query or code? A little more information is required. – Ryan-Neal Mes Apr 01 '14 at 20:57
-
I know MySQL would probably be involved, and I wanted the code for the program, and an idea of how to link the code and the database together. Thank you. – user3486787 Apr 01 '14 at 21:01
-
Oh, and everything you said previously is true. – user3486787 Apr 01 '14 at 22:08
1 Answers
1
Then it's simple. Create a table in your database called 'phrases' or something to that affect. Load the table into memory - in an array or something. Then cycle through each one doing a string compare or contains with your paragraph ... depending on what language you are using.
It's a little hard to give you any more information if you don't even say what language you are using.

Ryan-Neal Mes
- 6,003
- 7
- 52
- 77