Skip to content
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

Closed
Mezzenilium opened this issue Apr 16, 2022 · 4 comments
Closed

Regular expression search function #83

Mezzenilium opened this issue Apr 16, 2022 · 4 comments

Comments

@Mezzenilium
Copy link

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?

@rmanhaeve
Copy link
Contributor

I'm not entirely sure what you intend to do here. Could you perhaps clarify with a small example?

@Mezzenilium
Copy link
Author

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)).

@rmanhaeve
Copy link
Contributor

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:
https://github.com/ML-KULeuven/problog/blob/master/problog/library/string.py

@Mezzenilium
Copy link
Author

Ok, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants