0

I am currently working on a database with words from the english dictionary (selling original usernames) . My objective is to be able to display the definition of the usernames added to the database. Right now I'm working on proof of concept before applying the words from my database , but I cannot figure out how to format the preg match statements to get whether the word is a verb or noun etc, and the definition.
My code so far:

$content = file_get_contents("http://www.dictionary.com/browse/abut");

preg_match(?);
preg_match(?);

$class = $classmatch[];
$def = $defmatch[];


echo " $class <br> $def";
chris85
  • 23,846
  • 7
  • 34
  • 51
Pacified
  • 175
  • 9
  • looks like your breaching dictionary.com's terms –  Aug 22 '17 at 03:17
  • Oxford dictionary looks more lenient , thanks for the heads up – Pacified Aug 22 '17 at 03:30
  • there are a dozen dictionary api's you could use –  Aug 22 '17 at 03:32
  • Some words are both nouns and verbs. I think a regex is going to be hard to do this with, best too look at https://en.wikipedia.org/wiki/Natural_language_processing. If the question is specific about `mysqli` or just `preg_match` you should add in examples of that. – chris85 Aug 22 '17 at 04:06

0 Answers0