nerd/nerd_client.py
def _group_sentences(total_nb_sentences, group_length):
        """ Split sentences in groups, given a specific group length.

        Args:
            total_nb_sentences (int): Total available sentences.
            group_length (int): Limit of length for each group.

        Returns:
            list: Contains groups (lists) of sentences.
        """
        sentences_groups = []
        current_sentence_group = []

        for i in range(0, total_nb_sentences):
            if i % group_length == 0:
                if len(current_sentence_group) > 0:
                    sentences_groups.append(current_sentence_group)
                current_sentence_group = [i]
            else:
                current_sentence_group.append(i)

        if len(current_sentence_group) > 0:
            sentences_groups.append(current_sentence_group)

        return sentences_groups
def _group_sentences(total_nb_sentences, group_length):
        sentences_groups = []
        current_sentence_group = []

        for i in range(0, total_nb_sentences):
            if i % group_length == 0:
                if len(current_sentence_group) > 0:
                    sentences_groups.append(current_sentence_group)
                current_sentence_group = [i]
            else:
                current_sentence_group.append(i)

        if len(current_sentence_group) > 0:
            sentences_groups.append(current_sentence_group)

        return sentences_groups
def _group_sentences ( total_nb_sentences , group_length ) : sentences_groups = [ ] current_sentence_group = [ ] for i in range ( 0 , total_nb_sentences ) : if i % group_length == 0 : if len ( current_sentence_group ) > 0 : sentences_groups . append ( current_sentence_group ) current_sentence_group = [ i ] else : current_sentence_group . append ( i ) if len ( current_sentence_group ) > 0 : sentences_groups . append ( current_sentence_group ) return sentences_groups
Split sentences in groups, given a specific group length.

        Args:
            total_nb_sentences (int): Total available sentences.
            group_length (int): Limit of length for each group.

        Returns:
            list: Contains groups (lists) of sentences.
Split sentences in groups given a specific group length .