473,322 Members | 1,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

searching in paragraphs.

Hi,

I have a paragraph.

my search words are in parenthesis (grouped together).

for eq:- apple AND (mango OR orange)

It should retrieve the sentences which has apple (is a must word) along with it mango or orange has to be present.

2) (apple AND (mango OR orange) OR (pineapple AND pine)) AND potato.

same way apple has to be present along with that mango or orange or pineapple AND pine (either of them) can be present with that grouping potato has to present.

I am not able search for multiple parenthesis and groupings of words.

How should i process such query terms.

How should i search and retrieve the sentences?


with regards
Archana
Jan 11 '08 #1
4 1553
KevinADC
4,059 Expert 2GB
Perl has no way of knowing what any of that means. Have you written some sort of custom parsing code to first parse all that search stuff into something perl can understand? Or is that the queries for searching a database? If so, maybe you posted in the wrong forum.
Jan 11 '08 #2
Perl has no way of knowing what any of that means. Have you written some sort of custom parsing code to first parse all that search stuff into something perl can understand? Or is that the queries for searching a database? If so, maybe you posted in the wrong forum.
Hi,

what exacly i need to parse this expression.

Its something like the user gives his term/query with boolean combaination which includes nesting of words with paranthesis for eg . dog AND (cat OR (cow))
like this which basically had to split terms and search the paragraph.

The results would be the lines that has dog has a mandatory word either of cat or cow has to be present .

A kind of expression parser of boolean terms with paranthesis in perl .

How to do ?

with regards
Archana
Jan 12 '08 #3
eWish
971 Expert 512MB
I am not sure if this will help you or not. But I would have a look at the Search::Tools module at CPAN.

--Kevin
Jan 12 '08 #4
KevinADC
4,059 Expert 2GB
Hi,

what exacly i need to parse this expression.

Its something like the user gives his term/query with boolean combaination which includes nesting of words with paranthesis for eg . dog AND (cat OR (cow))
like this which basically had to split terms and search the paragraph.

The results would be the lines that has dog has a mandatory word either of cat or cow has to be present .

A kind of expression parser of boolean terms with paranthesis in perl .

How to do ?

with regards
Archana

If you want to code it yourself you will definetly have to use some regular expressions. This will not be too easy, you will have to do a lot of syntax checking to make sure the queries are well formed. If the users can enter nearly anything for the search terms you will probably have to build a complex data structure to break it all into it's various parts then reassemble them into regular expressions and then search the text.

Some of how you do this will depend on how you allow the user to input the queries. The more control the user has in writing the queries, the harder it will be for you to code. The less control the user has, the easier it should be to code.
Jan 12 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Sandman | last post by:
I am splitting a text block into paragraphs, to be able to add images and stuff like that to a specific paragraph in a content management system. Well, right now I'm splittin on two or more...
40
by: | last post by:
Could someone cite some offical rule or documentation with regard to the <P> tag? I've seen folks put it in between paragraphs... and others wrap it around a paragraph. I'd think to use it...
2
by: needhelp | last post by:
This one ought to be simple, but I have dug myself deeper and deeper, and gone farther and farther from what I wanted and I'm giving up. And my html that I've written is so bolloxed up now that...
7
by: Joe | last post by:
Hello, The code below is an entire HTML page that has a problem when using a <p> tag inside a CSS box (when running IE6). I was being a good boy and I replaced my single-cell <table> elements...
0
by: Josema | last post by:
Hi to all, Im trying to identify separately the tables and the paragraphs of a word document.. When i use the Word.Paragraphs interface to get all the paragraphs of a document i see that...
7
by: Jukka K. Korpela | last post by:
After noticing that IE 7 beta supports selectors like p+p, I started wondering how to achieve a simple rendering of paragraphs so that 1) there is no vertical spacing between paragraphs (i.e. the...
7
by: pbd22 | last post by:
Hi. I am somewhat new to this and would like some advice. I want to search my xml file using "keyword" search and return results based on "proximity matching" - in other words, since the search...
1
by: vierow | last post by:
new paragraphs in php mysql I have a php form to upload stories into a mysql database when I retrieve the file "print $row'; all the paragraphs run together. How do I get carriage returns...
1
by: xli1983 | last post by:
I'm a researcher, as well as a starter in python, i need to find key words, say earnings, sales, expenditure etc. in PDF documents, and extract relevant paragraphs around those key words out of the...
5
by: keoo | last post by:
Im putting the part of the code which is relevant to my question......The program is opening the texfile which i already have created..Im not quite managing to make the program count the number of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.