这是:
words = words.withColumn('value_2', F.regexp_replace('value', '|'.join(stopWords), ''))对子子很好。
然而,我有一个停止词'a‘,结果是’变成'ws‘。我只想看到它在'A‘或'a',和离开是一样的。
发布于 2022-04-16 16:56:59
把词的边界放在交替的周围:
words = words.withColumn('value_2', F.regexp_replace('value', '\\b(' + '|'.join(stopWords) + ')\\b', ''))https://stackoverflow.com/questions/71895757
复制相似问题