#NEWLINE# def splitNgramTerms( self , text ) : #NEWLINE# #INDENT# 'Split text into 1 to n gram terms\n        \n        ' #NEWLINE# terms = [ ] #NEWLINE# for sentence in lexicon . splitSentence ( self ) : #NEWLINE# #INDENT# if sentence : #NEWLINE# #INDENT# for mixed in lexicon . iterMixTerms ( sentence ) : #NEWLINE# #INDENT# if mixed . startswith ( 'E' ) : #NEWLINE# #INDENT# terms . append ( mixed ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# for n in xrange ( 1 , ( self . ngram + 1 ) ) : #NEWLINE# #INDENT# terms . extend ( lexicon . iterTerms ( n , mixed , False ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return terms