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.72k stars 1.58k forks source link

fix: `tenses` on English base form wrongly returns 3rd singular pres … #292

Closed JakobSteixner closed 4 years ago

JakobSteixner commented 4 years ago

Via a mapping from specific tense ids to defaults, tenses on English base forms wrongly yields the 3rd person singular indicative present as a candidate tense.

Example of previous faulty output: Attempting to get all forms of "demonstrate" that are parallel to the form "show"

 >>> import pattern.en as enp
 >>> candidate_tenses = enp.tenses('show')
 >>> print(set([enp.conjugate('demonstrate', *t) for t in candidate_tenses]))
{'demonstrate', 'demonstrates'}

Fixed by ignoring the default mapping when the tense_id has a specied form of its own.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.1%) to 68.398% when pulling 2658f539cb354bf591638d2a8d9fd0ee52231368 on JakobSteixner:fix/default-form-for-specific-tenses into 17f215438166729114762c3d9b3179dacd31490d on clips:development.