Пример #1
0
 def filter_rec(func, iterable):
     ret = []
     for item in iterable:
         if type(item) == list:
             ret.append(Utils.filter_rec(func, item))
         else:
             if func(item):
                 ret.append(item)
     return ret
Пример #2
0
 def filter_rec(func, iterable):
     ret = []
     for item in iterable:
         if type(item) == list:
             ret.append(Utils.filter_rec(func, item))
         else:
             if func(item):
                 ret.append(item)
     return ret
Пример #3
0
 def filter_words(words):
     return Utils.filter_rec(
         lambda x: x.split('_')[-1] in LdaUtils.NECESSARIES, words)
Пример #4
0
 def filter_words(words):
     return Utils.filter_rec(lambda x: x.split('_')[-1] in LdaUtils.NECESSARIES, words)