bug
[nltk_ontology_framework.git] / src / mjacob / ontologybuilder / simple_subterms.py
blob434e9dcd260e1b78116320e43ab9179edf1e09df
1 # This Python file uses the following encoding: utf-8
2 '''
3 Created on May 7, 2011
5 @author: mjacob
6 '''
8 class SimpleSubterms(object):
9 def __init__(self, minlength=1):
10 self.__minlength = minlength
12 def __call__(self, term):
13 for i in xrange(len(term)):
14 for j in xrange(i+self.__minlength, len(term)+1):
15 subterm = " ".join(s[0] for s in term[i:j])
16 yield subterm.lower()