-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regular expression search function #83
Comments
I'm not entirely sure what you intend to do here. Could you perhaps clarify with a small example? |
I would like to use a regular expression predicate (Python, Prolog offer this kind of service) like regexp(string, pattern) which searches if the pattern can be found in the string (true if Yes and false if No). Simplified use in Problog could be such as this : symptom(“ABD : PAIN, aching, dull pain / liver / colic, gall-stones / malarious disctricts”). symptom(“ABD : ERUPTIONS / RASH / red itching rash over the region of liver”). symptom(“CHT : ANXIETY in / Heart, region of / rising and walking, amel”). 0.3::diagnostic(“cirrhosis”) :- symptom(S), regexp(S, “liver”). query(diagnostic(M)). |
There's no such functionality currently in ProbLog. You could implement this functionality using the Python extern possibility as it is done in this library: |
Ok, thank you. |
Is it possible to use a regular expression search function in a string offered by python, to make a Problog predicate.
If so, would it be possible to have an example of such programming?
The text was updated successfully, but these errors were encountered: