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

    https://github.com/apache/spark/pull/21501#discussion_r194244784
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/feature/StopWordsRemover.scala ---
    @@ -84,7 +86,28 @@ class StopWordsRemover @Since("1.5.0") (@Since("1.5.0") 
override val uid: String
       @Since("1.5.0")
       def getCaseSensitive: Boolean = $(caseSensitive)
     
    -  setDefault(stopWords -> 
StopWordsRemover.loadDefaultStopWords("english"), caseSensitive -> false)
    +  /**
    +   * Locale of the input for case insensitive matching. Ignored when 
[[caseSensitive]]
    +   * is true.
    +   * Default: Locale.getDefault.toString
    +   * @see `StopWordsRemover.loadDefaultStopWords()`
    +   * @group param
    +   */
    +  @Since("2.4.0")
    +  val locale: Param[String] = new Param[String](this, "locale",
    +    "Locale of the input for case insensitive matching. Ignored when 
caseSensitive is true.",
    +    
ParamValidators.inArray[String](Locale.getAvailableLocales.map(_.toString)))
    +
    +  /** @group setParam */
    +  @Since("2.4.0")
    +  def setLocale(value: String): this.type = set(locale, value)
    --- End diff --
    
    Not sure if it is necessary. If users already have a `Locale` instance, 
they can use `toString` to provide the value. It is simpler if setter/getter 
have consistent types.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to