java从hashmap中删除停止词
我有一个hashmap,由作为单词(字符串)的键和作为计数(整数)的值组成
我必须从hashmap中删除stopwords。基本上,我必须做一个hMap。移除(“然后”),hMpa。删除(“where”)约67个单词。有没有更简单的方法?我可以在一次笔划中从hashmap中删除多个键吗
你可以在下面搜索框中键入要查询的问题!
我有一个hashmap,由作为单词(字符串)的键和作为计数(整数)的值组成
我必须从hashmap中删除stopwords。基本上,我必须做一个hMap。移除(“然后”),hMpa。删除(“where”)约67个单词。有没有更简单的方法?我可以在一次笔划中从hashmap中删除多个键吗
# 1 楼答案
以下几点应该能帮到你
希望这有帮助
# 2 楼答案
@user2623946 不,你必须使用收藏。 或者类似的:
# 3 楼答案
使用
hMap.keySet().removeAll(the_stuff_you_want_to_remove)
从documentation开始: