def text_to_strings_collection(text, words=3):
    """
    Splits the text to a collection of strings;
    a GAST for such a split collection usually produces
    better results in keyword matching that a GAST
    for the whole text. The word parameters determines
    how many words each string in the collection shall
    consist of (3 by default)
    
    return: Unicode
    """
    
    text = prepare_text(text)
    strings_collection = tokenize(text)
    strings_collection = filter(lambda s: 2 > len(s) and not s.isdigit(), strings_collection)
        
    i = 0
    strings_collection_grouped = []
    while i < len(strings_collection):
        group = ''
        for j in xrange(words):
            if i + j < len(strings_collection):
                group += strings_collection[i+j]
        strings_collection_grouped.append(group)
        i += words

    # Having an empty strings collection would lead to a runtime errors in the applications.
    if not strings_collection_grouped:
        strings_collection_grouped = [" "]
        
    return strings_collection_grouped
dataset/ETHPy150Open mikhaildubov/AST-text-analysis/east/utils.py/text_to_strings_collection/swapped operands of `>`