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

Only write those expressions to machine-readable AHBs, that are actually valid expressions #444

Open
hf-kklein opened this issue Sep 12, 2024 · 6 comments

Comments

@hf-kklein
Copy link
Contributor

          > warum wir die hier filtern und nicht die Datengrundlage selbst

ja, gerne :) da müsste halt kohlrahbi eine dependency auf ahbicht haben und nur diejenigen expressions schreiben, die auch well-formed sind. gerne ein issue da aufmachen ;) ich wäre mir nur unsicher, ob das out-of-scope ist.

Originally posted by @hf-kklein in https://github.com/Hochfrequenz/ahbicht-functions/issues/294#issuecomment-2345523263

@hf-kklein
Copy link
Contributor Author

from ahbicht.expressions.ahb_expression_parser import parse_ahb_expression_to_single_requirement_indicator_expressions

@lru_cache(maxsize=2**15)  # there are ~18k expressions over all AHBs as of 2024-09-11; So they all fit in 2**15
def is_wellformed_expression(expression: str) -> bool:
    """
    returns true iff the expression string is parseable by ahbicht
    """
    try:
        _ = parse_ahb_expression_to_single_requirement_indicator_expressions(expression)
        return True
    except (SyntaxError, VisitError):
        return False

@hf-krechan
Copy link
Collaborator

We try to ^^
There is a little conflict between AHB Tabellen and Bedinungsbaum/AHahnB.

In AHB Tabellen I would like to see even the wrong conditions.

@hf-kklein
Copy link
Contributor Author

It's not urgent then. We implemented the above filter on Entscheidungsbaum side already ;)

@hf-krechan
Copy link
Collaborator

hf-krechan commented Sep 16, 2024

And we have a real issue with it.
Unfortunately there are conditions which are real sentences :D

FV: 2404
Prüfi: 55001

image

@hf-krechan
Copy link
Collaborator

ggf. braucht der ahbicht bald auch ein LLM um diese Texte interpretieren zu können :D

@hf-kklein
Copy link
Contributor Author

nice. einmal mit profis arbeiten.🙃

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

2 participants