Inconsistent behaviour of multi-word patterns
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the reproduced calls to Pattern.fromstring() and search() in pattern.text.search, comparing the working “Windows Vista” pattern with the failing “is the best” pattern. Determine whether multi-word patterns are intended to support these word classes; done means either matching both examples correctly or documenting the supported limitation.
Written by the indexing model from the issue text.
Description
The Constraint syntax for multi-word expressions ("[ ]") only works for certain word classes (educated guess: noun phrase components?). Compare:
from pattern.text.search import search
from pattern.text.search import Pattern
txt = parsetree('Windows Vista is the best OS ever!')
pat = Pattern.fromstring('[Mac OS X | Windows Vista]')
print search(pat, txt)
[Match(words=[Word(u'Windows/NNP'), Word(u'Vista/NNP')])]
pat = Pattern.fromstring('[is the best | is the worst]')
print search(pat, txt)
[]
If this is intentional, the documentation should be updated accordingly. Otherwise, this is a bug in pattern matching.
- Dominant language
- Python
- Stars
- 8.9k
- Forks
- 1.6k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from clips/pattern
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
browser-use/browser-use#5905 ·
-
type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ynput/ayon-python-api#363 ·
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
modelscope/FunASR#3728 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
open-compass/opencompass#2655 ·