Replace y or Y with i if preceded by a non-vowel
        which is not the first letter of the word
        .

def replace_ys(self, word):
        """
        Replace y or Y with i if preceded by a non-vowel
        which is not the first letter of the word
        ."""
        length = len(word)

        if word[length - 1] in 'Yy':
            if length > 2:
                if word[length - 2] not in self.vowels:
                    word = word[:-1] + 'i'

        return word