def string2gender(self, string):
     # TODO: take care with trash strings before the name
     du = DameUtils()
     arr = du.string2array(string)
     name = ""
     i = 0
     features_int = self.features_int(string)
     while ((name == "") and (len(arr) > i)):
         if (not (self.guess_surname(arr[i], locale="us")[0])
                 and (len(string) > 0)):
             name = arr[i]
         i = i + 1
     return self.guess(name)
 def test_string2array(self):
     du = DameUtils()
     array = "muchos    espacios en blanco"
     arr = du.string2array(array)
     self.assertEqual(["muchos", "espacios", "en", "blanco"], arr)