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

    https://github.com/apache/spark/pull/21501#discussion_r194607278
  
    --- Diff: python/pyspark/ml/feature.py ---
    @@ -2582,25 +2582,31 @@ class StopWordsRemover(JavaTransformer, 
HasInputCol, HasOutputCol, JavaMLReadabl
                           typeConverter=TypeConverters.toListString)
         caseSensitive = Param(Params._dummy(), "caseSensitive", "whether to do 
a case sensitive " +
                               "comparison over the stop words", 
typeConverter=TypeConverters.toBoolean)
    +    locale = Param(Params._dummy(), "locale", "locale of the input. 
ignored when case sensitive " +
    +                   "is true", typeConverter=TypeConverters.toString)
     
         @keyword_only
    -    def __init__(self, inputCol=None, outputCol=None, stopWords=None, 
caseSensitive=False):
    +    def __init__(self, inputCol=None, outputCol=None, stopWords=None, 
caseSensitive=False,
    +                 locale=None):
             """
    -        __init__(self, inputCol=None, outputCol=None, stopWords=None, 
caseSensitive=false)
    +        __init__(self, inputCol=None, outputCol=None, stopWords=None, 
caseSensitive=false,
    +        locale=None)
             """
             super(StopWordsRemover, self).__init__()
             self._java_obj = 
self._new_java_obj("org.apache.spark.ml.feature.StopWordsRemover",
                                                 self.uid)
             
self._setDefault(stopWords=StopWordsRemover.loadDefaultStopWords("english"),
    -                         caseSensitive=False)
    +                         caseSensitive=False, 
locale=StopWordsRemover.defaultLocale())
    --- End diff --
    
    You already have the `_java_obj`, call `_java_object.getLocale()` would 
give you the default locale. And then Python users only need 
`stopWordsRemover.getLocale()` to get the default value. In the param doc, we 
should make it clear that the default would be the JVM default locale.


---

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

Reply via email to