def _sentence_to_features(self, sentence: list):<EOL>
sentence_features = []<EOL>prefixes = ('<STR_LIT>', '<STR_LIT:0>', '<STR_LIT>')<EOL>for word_idx in range(len(sentence)):<EOL><INDENT>word_features = {}<EOL>for i in range(<NUM_LIT:3>):<EOL><INDENT>if word_idx == len(sentence) - <NUM_LIT:1> and i == <NUM_LIT:2>:<EOL><INDENT>word_features['<STR_LIT>'] = True<EOL><DEDENT>elif word_idx == <NUM_LIT:0> and i == <NUM_LIT:0>:<EOL><INDENT>word_features['<STR_LIT>'] = True<EOL><DEDENT>else:<EOL><INDENT>word = sentence[word_idx - <NUM_LIT:1> + i]<EOL>prefix = prefixes[i]<EOL>features = self.crf_features[i]<EOL>for feature in features:<EOL><INDENT>value = self.function_dict[feature](word)<EOL>word_features[prefix + "<STR_LIT::>" + feature] = value<EOL><DEDENT><DEDENT><DEDENT>sentence_features.append(word_features)<EOL><DEDENT>return sentence_features<EOL>
Convert a word into discrete features in self.crf_features,
        including word before and word after.