Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7828#discussion_r36769419
  
    --- Diff: docs/ml-features.md ---
    @@ -267,22 +274,28 @@ for (Row r : wordsDataFrame.select("words", 
"label").take(3)) {
       for (String word : words) System.out.print(word + " ");
       System.out.println();
     }
    +
    +RegexTokenizer regexTokenizer = new 
RegexTokenizer().setInputCol("sentence").setOutputCol("words")
    +  .setPattern("\\W");
    +  // alternatively .setPattern("\\w+").setGaps(false);
     {% endhighlight %}
     </div>
     
     <div data-lang="python" markdown="1">
     {% highlight python %}
    -from pyspark.ml.feature import Tokenizer
    +from pyspark.ml.feature import Tokenizer, RegexTokenizer
     
     sentenceDataFrame = sqlContext.createDataFrame([
       (0, "Hi I heard about Spark"),
    -  (0, "I wish Java could use case classes"),
    -  (1, "Logistic regression models are neat")
    +  (1, "I wish Java could use case classes"),
    +  (2, "Logistic regression models are neat")
    --- End diff --
    
    Keep the example data in sync by replacing ` ` with `,` in this record.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to