title: SVM - passing a string to the CountVectorizer in Python vectorizes each character?
body: <p>I have a working SVM and the CountVectorizer works fine when the input to the <code>transform</code> function is a list of strings. However, if I just pass one string to it, the vectorizer iterates through each character in the string and vectorizes each one, even though I set the <code>analyzer</code> parameter to <code>word</code> when constructing the <code>CountVectorizer</code>.  </p>
  
  <pre><code>for x in range(0,3):
          test=raw_input("Type a message to classify: ")
          v=vectorizer.transform(test).toarray()
          print(v)
          print(len(v))
          print(svm.predict(vectorizer.transform(test).toarray()))
  </code></pre>
  
  <p>I'm able to fix this issue by changing the second line in the above code to:</p>
  
  <pre><code>test=[raw_input("Type a message to classify: ")]
  </code></pre>
  
  <p>But this seems strange to have a 1-item list. Isn't there a better way to do this without constructing a list?</p>