473,804 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Boolean parser..

Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live msn)) not web
I'm sorry my bad english.
King Regards..

Oct 4 '07 #1
5 2625
On Oct 5, 7:29 am, Abandoned <best...@gmail. comwrote:
Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live msn)) not web
I'm sorry my bad english.
King Regards..
Try the pyparsing module (google it)
They have several examples.

Oct 4 '07 #2
On 4 Ekim, 22:29, Abandoned <best...@gmail. comwrote:
Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live msn)) not web
I'm sorry my bad english.
King Regards..
This is a example written in perl "
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?tx tCodeId=350&lng WId=6"
but i don't find any python example

Oct 5 '07 #3
http://pyparsing.wikispaces.com/spac...earchparser.py this
is searchparser but i can't understant to use this.
Can anybody explain this how to use ?

Oct 5 '07 #4
On 10/4/07, Abandoned <be*****@gmail. comwrote:
Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live msn)) not web
I'm sorry my bad english.
King Regards..

--
http://mail.python.org/pipermail/pyt...st/399804.html
Oct 5 '07 #5
On Oct 4, 3:00 pm, timar...@gmail. com wrote:
On Oct 5, 7:29 am, Abandoned <best...@gmail. comwrote:
Hi..
I try a boolean parser in python since 1 weak.. But i can't do this
because this is very complicated :(
Do you know any blooean parser script in python or how do i write a
boolean parser ?
example query: ((google or yahoo) or (live msn)) not web
I'm sorry my bad english.
King Regards..

Try the pyparsing module (google it)
They have several examples.
The pyparsing wiki has this online example:
http://pyparsing.wikispaces.com/spac...earchparser.py.

-- Paul

Oct 5 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5289
by: Karalius, Joseph | last post by:
Can anyone explain what is happening here? I haven't found any useful info on Google yet. Thanks in advance. mmagnet:/home/jkaralius/src/zopeplone/Python-2.3.5 # make gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o Modules/python.o Modules/python.c gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I. -I./Include -DPy_BUILD_CORE -o...
3
3126
by: Himanshu Garg | last post by:
Hello, I am trying to pinpoint an apparent bug in HTML::Parser. The encoding of the text seems to change incorrectly if the locale isn't set properly. However Parser.pm in the directory (/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/HTML/) doesn't seem to contain the "real" parsing statements.
5
3609
by: Mad Scientist Jr | last post by:
Has anyone worked on code that that can parse evaluation expressions (could be numbers or strings) like ( ( "dog" = "dog" ) or "foo" = "bar" ) and ("cow" = "bat" and "bye" = "hi") or ("math" = "fun") or ( ( 1 = 5 ) or ( 2 < 3 ) ) and (1 <= 6)
2
4130
by: webposter | last post by:
Hi, I am looking for information on a data structure (and associated algorithm) to do short-circuit evaluation of boolean expressions and haven't found a single one even after googing for two days! Can anyone point me to good resources (or implementations) that do this. Basically is there any way to optimize a boolean expression expressed in RPN (reverse polish notation)? I want to implement the algorithm/data structure in C. If you...
10
8819
by: Simon Brooke | last post by:
The DOM API has included public Node importNode(Node,boolean) as a method of the Document interface for a long time. Does anything actually implement it? Xerces 2 is giving me: org.w3c.dom.DOMException: NOT_SUPPORTED_ERR: The implementation does not support the requested type of object or operation. at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source) at org.apache.xerces.dom.CoreDocumentImpl.importNode(Unknown Source)
28
16436
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to write a safe but easy implementation (i.e. no codedom) for an IBindingListView.Filter (by compiling to a Predicate<T>). Anybody know if this is possible at all? Marc
0
2244
by: UncleRic | last post by:
Environment: Mac OS X (10.4.10) on MacBook Pro I'm a Perl Neophyte. I've downloaded the XML::Parser module and am attempting to install it in my working directory (referenced via PERL5LIB env): PERL5LIB=/Users/Ric/Library/Perl/ ls XML-Parser-2.34/ XML-Parser-2.34.tar
4
6633
by: =?Utf-8?B?ZGF2ZWJ5dGhlc2Vh?= | last post by:
Hi folks, Boolean.Parse("true") returns true, but what if you need to parse something such as - Boolean.Parse("(false && false) || (false || (true && true))"); Does something exist in the .NET framework to Parse this kind of string to one final boolean result?
1
2116
by: sunil | last post by:
Hello, I have a boolean expression thats specified in pre/in/post fix notations, lets assume infix for the sake of this argument. The expression can be in any of the following forms: Form A: ------------- (As1&&/||Bs1&&/||Cs1 )|| (As2&&/||Bs2&&/||Cs2)||....(Asn&&/||Bsn&&/|| Csn) with following rules: -Inner ANDs/ORs are optional but if they are specified in one nesting they must be specified in all nestings with same connector type...
0
9716
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7644
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6874
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5536
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5676
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3839
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.