(corpus_file, side)
return num_feats
Peek one line and get number of features of it.
        (All lines must have same number of features).
        For text corpus, both sides are in text form, thus
        it works the same.

        Args:
            corpus_file (str): file path to get the features.
            side (str): 'src' or 'tgt'.

        Returns:
            number of features on `side`.
Peek one line and get number of features of it.
        (All lines must have same number of features).
        For text corpus, both sides are in text form, thus
        it works the same.
Peek one line and get number of features of it . ( All lines must have same number of features ) . For text corpus both sides are in text form thus it works the same .
def get_num_features(corpus_file, side):
        """
        Peek one line and get number of features of it.
        (All lines must have same number of features).
        For text corpus, both sides are in text form, thus
        it works the same.

        Args:
            corpus_file (str): file path to get the features.
            side (str): 'src' or 'tgt'.

        Returns:
            number of features on `side`.
        """
        with codecs.open(corpus_file, "r", "utf-8") as cf:
            f_line = cf.readline().strip().split()
            _, _, num_feats = TextDataset.extract_text_features(f_line)

        return num_feats
def get_num_features ( corpus_file , side ) : with codecs . open ( corpus_file , "r" , "utf-8" ) as cf : f_line = cf . readline ( ) . strip ( ) . split ( ) _ , _ , num_feats = TextDataset . extract_text_features ( f_line ) return num_feats