expansion: experiment with multi-letter firsts
We might be able to be faster (and more readable) if we could enhance our expansions to support label classes (possibly including ranges).
For instance on [a-z]*
, we compute:
In [3]: vcsn.context('lal_char(a-z), b').expression('[a-z]*').expansion()
Out[3]: <1> + a.[[^]*] + b.[[^]*] + c.[[^]*] + d.[[^]*] + e.[[^]*] + f.[[^]*] + g.[[^]*] + h.[[^]*] + i.[[^]*] + j.[[^]*] + k.[[^]*] + l.[[^]*] + m.[[^]*] + n.[[^]*] + o.[[^]*] + p.[[^]*] + q.[[^]*] + r.[[^]*] + s.[[^]*] + t.[[^]*] + u.[[^]*] + v.[[^]*] + w.[[^]*] + x.[[^]*] + y.[[^]*] + z.[[^]*]
There are reasons to hope that the following hypothetical run would be more efficient.
In [3]: vcsn.context('lal_char(a-z), b').expression('[a-z]*').expansion()
Out[3]: <1> + [a-z].[[^]*]
Maybe it would make sense only if we do have support for label classes in our expression ([^]
is actually output syntactic sugar for a+b+c+...+z
).
We should try not to kill the current performances we have with single letters though.