def split_1_grams_from_n_grams(topics_weightings):
    """
    Pair every words with their weightings for topics into dicts, for each topic.

    :param topics_weightings: it is a 3D list of shape [topics, number_of_top_words, 2] where
        the 2 is two entries such as (top_word, top_words_weighting).
    :return: Two arrays similar to the input array where the 1-grams were splitted from the
        n-grams. The n-grams are in the second array and the 1-grams in the first one.
    """
    _1_grams = [[] for _ in range(len(topics_weightings))]
    _n_grams = [[] for _ in range(len(topics_weightings))]

    for i, topic_words_list in enumerate(topics_weightings):
        for word, weighting in topic_words_list:
            tuple_entries = (word, weighting)
            if ' ' in word:
                _n_grams[i].append(tuple_entries)
            else:
                _1_grams[i].append(tuple_entries)
    return _1_grams, _n_grams