'Return a list of features, one for each start point in starts
and for each window length in winlen. If excludezero is True,
no Features containing 0 in its positions will be generated
(many tbl trainers have a special representation for the
target feature at [0])
For instance, importing a concrete subclass (Feature is abstract)
>>> from nltk.tag.brill import Word
First argument gives the possible start positions, second the
possible window lengths
>>> Word.expand([-3,-2,-1], [1])
[Word([-3]), Word([-2]), Word([-1])]
>>> Word.expand([-2,-1], [1])
[Word([-2]), Word([-1])]
>>> Word.expand([-3,-2,-1], [1,2])
[Word([-3]), Word([-2]), Word([-1]), Word([-3, -2]), Word([-2, -1])]
>>> Word.expand([-2,-1], [1])
[Word([-2]), Word([-1])]
a third optional argument excludes all Features whose positions contain zero
>>> Word.expand([-2,-1,0], [1,2], excludezero=False)
[Word([-2]), Word([-1]), Word([0]), Word([-2, -1]), Word([-1, 0])]
>>> Word.expand([-2,-1,0], [1,2], excludezero=True)
[Word([-2]), Word([-1]), Word([-2, -1])]
All window lengths must be positive
>>> Word.expand([-2,-1], [0])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "nltk/tag/tbl/template.py", line 371, in expand
:param starts: where to start looking for Feature
ValueError: non-positive window length in [0]
:param starts: where to start looking for Feature
:type starts: list of ints
:param winlens: window lengths where to look for Feature
:type starts: list of ints
:param excludezero: do not output any Feature with 0 in any of its positions.
:type excludezero: bool
:returns: list of Features
:raises ValueError: for non-positive window lengths'

@classmethod
def expand(cls, starts, winlens, excludezero=False):

    if (not all(((x > 0) for x in winlens))):
        raise ValueError(u'non-positive    window    length    in    {0}'.format(winlens))
    xs = (starts[i:(i + w)] for w in winlens for i in range(((len(starts) - w) + 1)))
    return [cls(x) for x in xs if (not (excludezero and (0 in x)))]
