(text_iter, truncate, side)
Args:
            text_iter (iterator): iterator of text sequences
            truncate (int): maximum sequence length (0 for unlimited).
            side (str): "src" or "tgt".

        Yields:
            (word, features, nfeat) triples for each line.
Args:
            text_iter (iterator): iterator of text sequences
            truncate (int): maximum sequence length (0 for unlimited).
            side (str): "src" or "tgt".
Args : text_iter ( iterator ) : iterator of text sequences truncate ( int ) : maximum sequence length ( 0 for unlimited ) . side ( str ) : src or tgt .
def make_examples(text_iter, truncate, side):
        """
        Args:
            text_iter (iterator): iterator of text sequences
            truncate (int): maximum sequence length (0 for unlimited).
            side (str): "src" or "tgt".

        Yields:
            (word, features, nfeat) triples for each line.
        """
        for i, line in enumerate(text_iter):
            # print('*' * 10)
            line = line.strip().split()

            if truncate:
                line = line[:truncate]

            words, feats, n_feats = \
                TextDataset.extract_text_features(line)

            # print (line)
            # print (words)

            example_dict = {side: words, "indices": i}
            if feats:
                prefix = side + "_feat_"
                example_dict.update((prefix + str(j), f)
                                    for j, f in enumerate(feats))
            yield example_dict, n_feats
def make_examples ( text_iter , truncate , side ) : for i , line in enumerate ( text_iter ) : # print('*' * 10) line = line . strip ( ) . split ( ) if truncate : line = line [ : truncate ] words , feats , n_feats = TextDataset . extract_text_features ( line ) # print (line) # print (words) example_dict = { side : words , "indices" : i } if feats : prefix = side + "_feat_" example_dict . update ( ( prefix + str ( j ) , f ) for j , f in enumerate ( feats ) ) yield example_dict , n_feats