def test_collection_invalid(self): collection = GenderCollection() self.assertIsNotNone(collection) collection.add_to_lookup("with him", 'with her') self.assertFalse(collection.has_keyVal("WITH YOU")) self.assertIsNone(collection.value("WITH YOU")) self.assertIsNone(collection.gender("WITH YOU")) self.assertEqual(collection.genderise_string(None, "This is with you"), "This is with you")
def test_collection_operations(self): collection = GenderCollection() self.assertIsNotNone(collection) collection.add_to_lookup("with him", 'with her') self.assertTrue(collection.has_keyVal("WITH HIM")) self.assertEqual('with her', collection.value("WITH HIM")) self.assertEqual(collection.gender("WITH HIM"), 'with her') self.assertEqual(collection.genderise_string(None, "This is with him"), "This is with her")
def test_collection_invalid_JP(self): collection = GenderCollection() self.assertIsNotNone(collection) collection.add_to_lookup("彼", '彼女') self.assertFalse(collection.has_keyVal("彼氏")) self.assertIsNone(collection.value("彼氏")) tokenizer = TokenizerJP() self.assertIsNone(collection.gender("彼氏")) self.assertEqual(collection.genderise_string(tokenizer, "彼氏が来た"), "彼氏が来た")
def test_collection_operations_JP(self): collection = GenderCollection() self.assertIsNotNone(collection) collection.add_to_lookup("彼", '彼女') tokenizer = TokenizerJP() self.assertTrue(collection.has_keyVal("彼")) self.assertEqual('彼女', collection.value("彼")) self.assertEqual(collection.gender("彼"), '彼女') self.assertEqual(collection.genderise_string(tokenizer, "彼が来た"), "彼女が来た")