clips / pattern

Web mining module for Python, with tools for scraping, natural language processing, machine learning, network analysis and visualization.
https://github.com/clips/pattern/wiki
BSD 3-Clause "New" or "Revised" License
8.76k stars 1.58k forks source link

Failing unit test test_find_keywords (pattern.text) #191

Open markus-beuckelmann opened 7 years ago

markus-beuckelmann commented 7 years ago

From https://github.com/clips/pattern/commit/75e4c51b6bd98866d45e3ffd397328609a25b942 onwards, test_text.py::TestParser::test_find_keywords fails.

Specifically, according to the test case,

from pattern import text
p = text.Parser()
p.lexicon["the"] = "DT"
p.lexicon["cat"] = "NN"
p.lexicon["dog"] = "NN"
p.find_keywords("cat. dog. dog.")

should return ["dog", "cat"] but instead return ["cat", "dog"]. There were major changes introduced in https://github.com/clips/pattern/commit/75e4c51b6bd98866d45e3ffd397328609a25b942, so I'm not even totally sure if the test case is still correct.