Ejemplo n.º 1
0
def get_plural_value(value):
    if value.endswith('ife'):
        return value[:-3] + 'ives'
    elif any(
            value.endswith('{}f'.format(ending))
            for ending in ('al', 'el', 'ar', 'ea', 'ol')):
        return value[:-1] + 'ves'
    else:
        return add_s(value)
Ejemplo n.º 2
0
    def third_person(self):
        if self.has_tags(WordTag.THIRD_PERSON):
            return self

        new_tags = self.tags.add(WordTag.THIRD_PERSON).remove(WordTag.PAST)
        if self.has_tags(WordTag.NEGATIVE):
            return Verb("doesn't " + self.infinitive, self.irregular_past,
                        self.infinitive, new_tags)

        with_s = add_s(self.infinitive)
        if with_s == 'haves':
            with_s = 'has'
        return Verb(with_s, self.irregular_past, self.infinitive, new_tags)
Ejemplo n.º 3
0
 def test_add_s_needs_es(self):
     es_words = ('buzz', 'fitch', 'fess', 'ax', 'dish', 'bobo')
     for word in es_words:
         self.assertEqual(add_s(word), word + 'es')
Ejemplo n.º 4
0
 def test_add_s_others(self):
     self.assertEqual(add_s('play'), 'plays')
     self.assertEqual(add_s('baa'), 'baas')
     self.assertEqual(add_s('egg'), 'eggs')
Ejemplo n.º 5
0
    def test_add_s_ies(self):
        self.assertEqual(add_s('baby'), 'babies')
        self.assertEqual(add_s('harpy'), 'harpies')
        self.assertEqual(add_s('cry'), 'cries')

        self.assertNotEqual(add_s('play'), 'plaies')