def encode(self, txt):
return list(self._fwd_index.get(c, <NUM_LIT:0>) for c in txt)<EOL>
Encode a text string by replacing characters with alphabet index.

        Parameters
        ----------
        txt : str
            A string to encode.

        Returns
        -------
        classes : list of int
            A sequence of alphabet index values corresponding to the given text.