使用 NLTK 获取以下内容的唯一词频的代码。
Seq Sentence
1 Let's try to be Good.
2 Being good doesn't make sense.
3 Good is always good.
输出:
{'good':3, 'let':1, 'try':1, 'to':1, 'be':1, 'being':1, 'doesn':1, 't':1, 'make':1, 'sense':1, 'is':1, 'always':1, '.':3, ''':2, 's':1}
我想获取上个月的最后日期,我使用的代码是
date -d "$(2022-04-30 +%Y%m01) -1 month" +%Y-%m-%d. 我得到的输出是 2022-04-24 而不是 2022-03-31。我使用的是 Debian Linux。