使用单词列表生成所有句子的排列
ak-phrase.p的Python项目详细描述
ak短语.py
这个库从2d数组中的单词生成句子的所有排列。
它遵循句子中的单词顺序,与数组列中的单词顺序相同。
安装
$ pip3 install ak-phrase.py
用法
fromak-phase.pyimportSentenceGeneratorword_lists=[['eat'],['code','commit'],['sleep']]sentences=SentenceGenerator.generate_sentences(word_lists)print(sentences)# Output:# [ 'eat code sleep', 'eat commit sleep' ]
贡献
有兴趣参与这个项目吗? 您可以记录与此库有关的任何问题或建议here
阅读我们的贡献guide开始贡献代码库