1 # This Python file uses the following encoding: utf-8
8 class SimpleSubterms(object):
10 returns a collection of subterm strings from a collection of tokens
11 this version just assumes all possible substrings are possible, up to
12 an optionally specified "minimal length"
14 def __init__(self
, minlength
=1):
15 self
.__minlength
= minlength
17 def __call__(self
, term
):
18 for i
in xrange(len(term
)):
19 for j
in xrange(i
+self
.__minlength
, len(term
)+1):
20 subterm
= " ".join(term
[i
:j
])