Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>The program tries to deduce a regex that fits the examples </p> </blockquote> <p>I don't think it's a useful question to ask. You have to know semantically what you need to represent to deduce something. When you write a regex, you have a purpose: accepting urls, accepting emails, extracting tokens from code, etc. I would redefine the question as so: given a knowledge base and a semantic for regular expression, compute the smallest regex. This get a step further, because you have natural language trying explaining a general expression and we all know how it get ambiguous! You have to have some semantic explanation. Without that, the best thing you can do for examples is to compute regex that cover all string from the ok list.</p> <p>Algorithm for coverage:</p> <p>Populate Ok List<br> Populate Not ok List<br> Check for repetitions<br> Check for contradictions ( the same string cannot be in both list )<br> Create Deterministic Finite Automata (DFA) from Ok List where strings from the list are final states<br> Simplify the DFA by eliminating repetitive states. ([1] 4.4 )<br> Convert DFA to regular expression. ([1] 3.2.2 )<br> Test Ok list and Not ok list</p> <p><a href="http://rads.stackoverflow.com/amzn/click/0201441241" rel="nofollow noreferrer"><br> [1] Introduction to Automata Theory, Language, and Computation. J. Hopcroft, R. Motwani, J.D. Ullman, 2nd Edition, Pearson Education. </a></p> <p>P.S.</p> <p>I had some experience with genetic programming and I think it's really overhead for your problem. Since the objective function is really light it's better to evaluate with a single processor and this can take a lot of time. To have shorter expression you just need to minimize the DFA. But GA may possibly produce interesting result.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload