[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Plain english to condition??

Varun Goel

5/7/2008 4:59:00 AM

Hi All,
I wanna to do something like as:
1. Use will type plain English in text box like designation equals PM or
designation = PM.

2.Then i have to save this rule in DB and i have to made some function
to verify this rule.

3. My problem is that how to make if condition for following rule
dynamically.Cos in ROR i can say designation == 'PM'then fine but how i
will check that designation equals PM.

4.Means i have to make condition from plain english dynamically.

Please tell me ur suggestions.

Thanks
Varun
--
Posted via http://www.ruby-....

2 Answers

Phlip

5/7/2008 11:42:00 AM

0

Varun Goel wrote:

> I wanna to do something like as:
> 1. Use will type plain English in text box like designation equals PM or
> designation = PM.

This is not always the best idea. Natural language parsing is a wild
topic, and it typically offends users.

For example, Google does _not_ search using natural language. They
use a very few keywords - easy to stumble across - and they allow the
user to feel secure knowing which commands do what.

Now what is your actual problem? Which query will your users most
likely need? Can you implement that, briefly, and put it online?
Can your users try it, and learn what query they will need next?

--
Phlip

Daniel Finnie

5/7/2008 3:52:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Why not have one input box on the right and one on the left with an equals
sign in the middle. Then you can so something like this:

left_box = "designation"
right_box = "PM"

model_instance.send(left_box) == right_box

Of course, be sure to sanitize your input. You don't want to call destroy!
or something on model_instance.

Dan

On 5/7/08, Varun Goel <varun.rajeshkumar@gmail.com> wrote:
>
> Hi All,
> I wanna to do something like as:
> 1. Use will type plain English in text box like designation equals PM or
> designation = PM.
>
> 2.Then i have to save this rule in DB and i have to made some function
> to verify this rule.
>
> 3. My problem is that how to make if condition for following rule
> dynamically.Cos in ROR i can say designation == 'PM'then fine but how i
> will check that designation equals PM.
>
> 4.Means i have to make condition from plain english dynamically.
>
> Please tell me ur suggestions.
>
> Thanks
> Varun
> --
> Posted via http://www.ruby-....
>
>