Beispiel #1
0
 def test_antonym_valid_phrase_2(self):
     current_result = vb.antonym("respect")
     result = '{"text": ["disesteem", "disrespect"]}'
     expected_result = json.loads(result)
     if sys.version_info[:2] <= (2, 7):
         self.assertItemsEqual(current_result, expected_result)
     else:
         self.assertCountEqual(current_result, expected_result)
Beispiel #2
0
 def test_antonym_2(self):
     current_result = vb.antonym("respect")
     result = '{"text": ["disesteem", "disrespect"]}'
     expected_result = json.loads(result)
     self.assertEqual(current_result, expected_result)
Beispiel #3
0
 def test_antonym_1(self):
     current_result = vb.antonym("love")
     result = '{"text": ["hate"]}'
     expected_result = json.loads(result)
     self.assertEqual(current_result, expected_result)
Beispiel #4
0
def antonyms(word):
   try:
     result=vb.antonym(word)
     return ','.join(x for x in result['text'])  + '\n'
   except:
      return "N/A"
Beispiel #5
0
 def test_antonym_not_valid_phrase(self):
     current_result = vb.antonym("sxsw")
     self.assertFalse(current_result)
Beispiel #6
0
 def test_antonym_2(self):
     current_result = vb.antonym("respect")
     result = '{"text": ["disesteem", "disrespect"]}'
     expected_result = json.loads(result)
     self.assertEqual(current_result, expected_result)
Beispiel #7
0
 def test_antonym_1(self):
     current_result = vb.antonym("love")
     result = '{"text": ["hate"]}'
     expected_result = json.loads(result)
     self.assertEqual(current_result, expected_result)