def get_features(self, context_obj):
        if 'source' not in context_obj or context_obj['source'] is None:
            raise NoDataError('source', context_obj, 'AlignmentFeatureExtractor')
        if 'target' not in context_obj or context_obj['source'] is None or context_obj['target'] is None:
            raise NoDataError('target', context_obj, 'AlignmentFeatureExtractor')

        if 'alignments' not in context_obj:
            raise NoDataError('alignments', context_obj, 'AlignmentFeatureExtractor')
#            if self.model == '':
#                raise NoDataError('alignments', context_obj, 'AlignmentFeatureExtractor')
#            context_obj['alignments'] = align_sentence(context_obj['source'], context_obj['target'], self.model)

        # source word(s)
        try:
            align_idx = context_obj['alignments'][context_obj['index']]
        except IndexError:
            print("{} items in the alignment, needed {}-th".format(len(context_obj['alignments']), context_obj['index']))
            print(context_obj['alignments'], context_obj['target'], context_obj['source'])
            sys.exit()
        # if word is unaligned - no source and no source contexts
        if align_idx == None:
            return ['__unaligned__', '|'.join(['__unaligned__' for i in range(self.context_size)]), '|'.join(['__unaligned__' for i in range(self.context_size)])]

        # TODO: find contexts for all words aligned to the token (now only 1st word)
        else:
            left = '|'.join(left_context(context_obj['source'], context_obj['source'][align_idx], context_size=self.context_size, idx=align_idx))
            right = '|'.join(right_context(context_obj['source'], context_obj['source'][align_idx], context_size=self.context_size, idx=align_idx))

        aligned_to = context_obj['source'][align_idx]
        return [aligned_to, left, right]
dataset/ETHPy150Open qe-team/marmot/marmot/features/alignment_feature_extractor.py/AlignmentFeatureExtractor.get_features/original