Ejemplo n.º 1
0
    def test_similar_bad_grammar(self):
        extension = SynsetsExtension()
        self.assertIsNotNone(extension)

        self.assertEqual("FALSE", extension.execute(self.context, "SIMILAR"))
        self.assertEqual("FALSE", extension.execute(self.context, "SIMILAR WORD1"))
        self.assertEqual("FALSE", extension.execute(self.context, "SIMILAR WORD1 WORD2 WORD3"))
        self.assertEqual("FALSE", extension.execute(self.context, "SIMILAR OCTOPUS SHRIMP 0 DOT 9 WORD7"))
        self.assertEqual("FALSE", extension.execute(self.context, "SIMILARS OTHER GENTLY"))
        self.assertEqual("FALSE", extension.execute(self.context, "OTHER OTHER GENTLY"))
Ejemplo n.º 2
0
 def __init__(self):
     SynsetsExtension.__init__(self)
Ejemplo n.º 3
0
 def test_is_similars_adverbs(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEqual("TRUE GENTLY LIGHTLY", extension.execute(self.context, "SIMILARS ADVERBS GENTLY"))
Ejemplo n.º 4
0
 def test_is_similars_adjectives(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEqual("TRUE LARGE BOMBASTIC BIG", extension.execute(self.context, "SIMILARS ADJECTIVES LARGE"))
Ejemplo n.º 5
0
 def test_is_similars_nouns(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEqual("TRUE CAR CABLE_CAR", extension.execute(self.context, "SIMILARS NOUNS CAR"))
Ejemplo n.º 6
0
 def test_is_similars_verbs(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEqual("TRUE RUN SCAT OPERATE FUNCTION RANGE CAMPAIGN PLAY TEND PREVAIL CARRY GUIDE PLY HUNT RACE MOVE MELT LADDER", extension.execute(self.context, "SIMILARS VERBS RUNNING"))
Ejemplo n.º 7
0
 def test_is_similars_words(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEqual("TRUE HACK MACHINE_POLITICIAN CAB CHOP", extension.execute(self.context, "SIMILARS WORDS HACK"))
Ejemplo n.º 8
0
    def test_similars_bad_grammar(self):
        extension = SynsetsExtension()
        self.assertIsNotNone(extension)

        self.assertEqual("FALSE", extension.execute(self.context, "SIMILARS WORDS HACK WORD4"))
        self.assertEqual("FALSE", extension.execute(self.context, "SIMILARS OTHER HACK WORD4"))
Ejemplo n.º 9
0
 def test_is_similar_height_weight(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEqual("FALSE", extension.execute(self.context, "SIMILAR OCTOPUS SHRIMP 0 DOT 9"))
Ejemplo n.º 10
0
 def test_is_similar_low_weight(self):
     extension = SynsetsExtension()
     self.assertIsNotNone(extension)
     self.assertEquals(
         "TRUE",
         extension.execute(self.context, "SIMILAR OCTOPUS SHRIMP 0 DOT 1"))