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

Rule representation #58

Open
GoogleCodeExporter opened this issue Mar 3, 2016 · 3 comments
Open

Rule representation #58

GoogleCodeExporter opened this issue Mar 3, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

I have a restriction case that I don't know how to represent in regex:

A ?* Z ?* N => A ?* Z ?* C ?* N

That means, every time the sequence AZN appears, the element C must be between 
Z and N, but this sequence can have some other elements in between without 
altering  the order of the sequence, for instance
AbhsZCN
AjsZkeCN
AoiZpsCxmN
AZreCN
etc.
These are the actual elements (this is a wrong representation, the "->" is not 
right)
[["@N" ?* "+VRB" ?* "+ADV"] -> ["@N" ?* "+VRB" ?* "+PVN" ?* "+ADV"]]


Thanks....

Original issue reported on code.google.com by andreschandiaf on 19 Mar 2015 at 7:31

@GoogleCodeExporter
Copy link
Author

I have reformulated the question so maybe it is more understandable:

I have a language that can basically be in the next form:

ROOT+S36+S35+S34.......+S15+S14.........+S2+S1

but there are restrictions that make the root appear with only some suffixes 
and not with all the 36, for instance:

[ ~$[S36 ?* [S20|S12|S2]];  ! S36 can not combine with S20, S12 or S2
[S14 => ?* _ ?* S7 ?*]; ! Every time that S14 appears, S7 must also appear
[[S10 => ?* S12 ?* _ ?* S8] | [S10 => ?* _ ?* S7 ?*]]; ! Every time S10 
appears, it must appear either between S12 and S8, or with S7
etc.
and here comes the one I don't know how to express in regex:

! Every time the sequence [?* S36 ?* S20 ?* S5 ?*] appears, it must appear S8 
between S20 and S5, like this: [?* S36 ?* S20 ?* S8 ?* S5 ?*]

That is the question, and thanks again......

Original comment by andreschandiaf on 20 Mar 2015 at 9:34

@GoogleCodeExporter
Copy link
Author

First, this part:

[S10 => ?* S12 ?* _ ?* S8] | [S10 => ?* _ ?* S7 ?*]

should probably read:

[S10 => S12 ?* _ ?* S8 ,  _  ?* S7]

(that's how two contexts are specified; also you don't need ?* at edges)

The actual question is: when you see ?* S36 ?* S20 ?* S5 ?*, S8 must appear 
between S20 and S5. This seems like it's doable without context restriction, 
like so:

~$[?* S36 ?* S20 ~$S8 S5 ?*]

Original comment by [email protected] on 21 Mar 2015 at 3:03

@GoogleCodeExporter
Copy link
Author

Ok, thanks a lot for the two things, great! I see it now!

Original comment by andreschandiaf on 21 Mar 2015 at 3:10

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

No branches or pull requests

1 participant