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

How can unglue deal with repeated patterns ? #29

Open
moodymudskipper opened this issue Dec 16, 2022 · 0 comments
Open

How can unglue deal with repeated patterns ? #29

moodymudskipper opened this issue Dec 16, 2022 · 0 comments

Comments

@moodymudskipper
Copy link
Owner

What to do with :

Valve AA has flow rate=0; tunnels lead to valves DD, II, BB
Valve BB has flow rate=13; tunnels lead to valves CC, AA

we can of course match the repeated part separately then use other tools, can we do better ? What would be the syntax ? Note that in this case as in most (I think) we have separators (on less by item by definition)

Maybe something like : "Valve {valves} has flow rate={rate}; tunnels lead to valves {to+=pattern}"

The + here means we match the same strings as "Valve {valves} has flow rate={rate}; tunnels lead to valves {to=pattern+}" but the output would be treated differently. we can generalise it to * and {n}, and ?.

Where we'd need a lookahead in the pattern if we're to account for separators, but maybe that's ok if we have a good example. Results would be nested and converted if relevant.

Then there is the technical question, the above might change the pattern to "(pattern)(pattern)?(pattern)?..." with a default tweak able max length, ugly but might work ?

Other option is to have an unglue_repeated() family of functions that we might use on the output of a regular output, these would have an optional sep arg.

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

1 participant