code: def test_case(self):
      # Swap
      aug = naw.RandomWordAug(action="swap")
      augmented_data = aug.augment("aA bB")
      augmented_text = augmented_data[0]
      self.assertEqual("bB aA", augmented_text)
  
      data = "I love McDonalds"
      doc = Doc(data, aug.tokenizer(data))
      augmented_tokens = aug.change_case(
          doc, 1, 0, 1
      ).get_augmented_tokens()
      self.assertEqual(["Love", "I", "McDonalds"], augmented_tokens)
      doc = Doc(data, aug.tokenizer(data))
      augmented_tokens = aug.change_case(
          doc, 0, 1, 1
      ).get_augmented_tokens()
      self.assertEqual(["Love", "I", "McDonalds"], augmented_tokens)
  
      data = "He loves McDonalds"
      doc = Doc(data, aug.tokenizer(data))
      augmented_tokens = aug.change_case(
          doc, 1, 0, 1
      ).get_augmented_tokens()
      self.assertEqual(["Loves", "he", "McDonalds"], augmented_tokens)
      doc = Doc(data, aug.tokenizer(data))
      augmented_tokens = aug.change_case(
          doc, 0, 1, 1
      ).get_augmented_tokens()
      self.assertEqual(["Loves", "he", "McDonalds"], augmented_tokens)
      doc = Doc(data, aug.tokenizer(data))
      augmented_tokens = aug.change_case(
          doc, 2, 1, 1
      ).get_augmented_tokens()
      self.assertEqual(["He", "McDonalds", "loves"], augmented_tokens)
  
      # Insert
      aug = naw.TfIdfAug(
          model_path=self.tfidf_model_path, action="insert"
      )
      expected = False
      for i in range(10):
          augmented_data = aug.augment("Good")
          augmented_text = augmented_data[0]
          if (
              "good" in augmented_text
              and aug.get_word_case(augmented_text.split(" ")[0])
              == "capitalize"
          ):
              expected = True
              break
      self.assertTrue(expected)
  
      # Substitute
      aug = naw.RandomWordAug(action="substitute", target_words=["abc"])
      expected = False
      for i in range(10):
          augmented_data = aug.augment("I love")
          augmented_text = augmented_data[0]
          if augmented_text == "Abc love":
              expected = True
              break
      self.assertTrue(expected)
  
      aug = naw.AntonymAug()
      aug_data = aug.augment("Happy")
      self.assertEqual("Unhappy", aug_data[0])
  
      # Do not change if target word is non-lower
      aug = naw.SpellingAug()
      aug_data = aug.augment("Re")
      self.assertEqual("RE", aug_data[0])
  
      # Delete case
      aug = naw.RandomWordAug(action="delete")
      expected = False
      for i in range(10):
          augmented_data = aug.augment("I love")
          augmented_text = augmented_data[0]
          if augmented_text == "Love":
              expected = True
              break
      self.assertTrue(expected)
  
file_path: nlpaug/test/augmenter/word/test_word.py
imports: import unittest
  import os
  from dotenv import load_dotenv
  import nlpaug.augmenter.word
  from nlpaug.util import Action, Doc
label_desc: Use image node_id 4 for calling the TestWord obj's underlying member method code with example usage: obj.test_case() without return types