class_docstr: Test the text utilities for creating and cleaning features.
class_docstr_tok: ["Test","the","text","utilities","for","creating","and","cleaning","features","."]
code: def test_drop_words(self):
      ## Bogus input type
      sa = tc.SArray([1, 2, 3])
      with self.assertRaises(RuntimeError):
          text_analytics.drop_words(sa)
  
      sa = tc.SArray(["str", None])
      # no throw, just give warning and skip
      # avoid segfault
      stop_words = text_analytics.stop_words()
      text_analytics.drop_words(sa, stop_words=stop_words)
  
      ## Other languages
      expected = [
          "this is someurl http someurl this is someurl http someurl",
          "中文 应该也 行 中文 应该也 行",
          "Сблъсъкът между Сблъсъкът между",
      ]
  
      expected2 = [
          "This is someurl http someurl This is someurl http someurl",
          "中文 应该也 行 中文 应该也 行",
          "Сблъсъкът между Сблъсъкът между",
      ]
  
      result = text_analytics.drop_words(self.languages_double)
      self.assertEqual(result.dtype, str)
      self.sframe_comparer._assert_sarray_equal(result, expected)
  
      result = text_analytics.drop_words(
          self.languages_double, to_lower=False
      )
      self.assertEqual(result.dtype, str)
      self.sframe_comparer._assert_sarray_equal(result, expected2)
  
      ## Check that delimiters work properly by default and when modified.
      expected1 = [
          "this is some url http www someurl com this is some url http www someurl com",
          "should we yes we should should we yes we should",
      ]
      expected2 = [
          "this is some url http://www.someurl.com this is some url http://www.someurl.com",
          "should we yes we should. should we yes we should.",
      ]
      expected3 = ["url http www someurl url http www someurl", ""]
  
      word_counts1 = text_analytics.drop_words(self.punctuated_double)
      word_counts2 = text_analytics.drop_words(
          self.punctuated_double, delimiters=["?", "!", ",", " "]
      )
      word_counts3 = text_analytics.drop_words(
          self.punctuated_double, stop_words=text_analytics.stop_words()
      )
  
      self.assertEqual(word_counts1.dtype, str)
      self.sframe_comparer._assert_sarray_equal(word_counts1, expected1)
      self.assertEqual(word_counts2.dtype, str)
      self.sframe_comparer._assert_sarray_equal(word_counts2, expected2)
      self.assertEqual(word_counts3.dtype, str)
      self.sframe_comparer._assert_sarray_equal(word_counts3, expected3)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import math
  import unittest
  import warnings
  import turicreate
  import turicreate.toolkits.text_analytics
  from .None import util
label_desc: Use image node_id 4 for calling the FeatureEngineeringTest obj's underlying member method code with example usage: obj.test_drop_words() without return types