pouncer Posted March 30, 2007 Share Posted March 30, 2007 Hey guys, i want to make a sophisticated search. How can i get the adjectives and nouns from a sentence? Quote Link to comment Share on other sites More sharing options...
Full-Demon Posted March 30, 2007 Share Posted March 30, 2007 Doing something with language with a computer is very very difficult, because languages contain large amounts of "flaws". So many exceptions. Although nouns are totally random. However, you can inspect a complete sentence, defining what is what (verb, subject, etc), than you can maybe see what is a noun and what not. OR you can put every noun/adjective in an array and use regular expressions to check out if that sentence contains that specific noun... Have luck lol, not to discourage you, but its a helluva work Full-Demon Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 30, 2007 Share Posted March 30, 2007 It's beyond 'helluva'. Languages simple do not lend themselves to that sort of analysis by rules, especially where nouns can be used as adjectives (Georgia peach, farewell letter are two wiki examples). http://en.wikipedia.org/wiki/Adjective will give you more information about adjectives than you'll need in a lifetime. Quote Link to comment Share on other sites More sharing options...
pouncer Posted March 30, 2007 Author Share Posted March 30, 2007 ah, problem then! thing is, my website is about creating collections. say i create a collection on 'my old stamps' and tim creates a collection on 'my old houses' say i then search for 'similar' collections, it shud bring up the 'my old houses' collection with the word 'old' in bold. so how else could i do this? Quote Link to comment Share on other sites More sharing options...
Full-Demon Posted March 30, 2007 Share Posted March 30, 2007 User regular expressions to search for the word old, stamps or houses. But I guess it shouldnt search for 'my', isnt it? Google for regular expressions, you need to make a function that will search through a database to match a certain word. Full-Demon Quote Link to comment Share on other sites More sharing options...
per1os Posted March 30, 2007 Share Posted March 30, 2007 Almound joys got nutz, Nounds don't =) Yea, this would be a serious task to undertake you would have to create a bunch of rules and be able to analyze the sentence like MS Word does. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted March 30, 2007 Share Posted March 30, 2007 Making a script/program that can place words into different classes would be very complex, especially, as obsidian said, as some words can be a different word class depending on how you use them. In order of your script to understand the sentence, and thereby distinguish the ten word classes (interjections, numerals, conjunctions, prepositions, adverbs, verbs, pronouns, articles, nouns, adjectives), it would need some artificial intelligence and it would need to know how word morphology works (perhaps knowledge of its syntax would help as well?). There are people who work with nothing else than morphology. Languages are rather complex. Quote Link to comment Share on other sites More sharing options...
pouncer Posted March 30, 2007 Author Share Posted March 30, 2007 Thanks for the input guys. What other ways do you guys suggest I can tackle this 'search' problem guys? Quote Link to comment Share on other sites More sharing options...
Full-Demon Posted March 31, 2007 Share Posted March 31, 2007 User regular expressions to search for the word old, stamps or houses. But I guess it shouldnt search for 'my', isnt it? Google for regular expressions, you need to make a function that will search through a database to match a certain word. Full-Demon Easiest way, IMO. Full-Demon Quote Link to comment Share on other sites More sharing options...
Barand Posted March 31, 2007 Share Posted March 31, 2007 Then try your program on these two sentences Time flies like an arrow Fruit flies like a banana Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.