Skip to content
Discussion options

You must be logged in to vote

You're not missing anything here. It's fine to provide multiple patterns for a single match_id, but it's true it doesn't always work well with alignments.

The issue here is that while the Matcher has been in spaCy for a long time, alignments were not initially planned as a feature and were only added relatively recently. Unfortunately they don't cover this kind of case where it's not clear how they map back because you have multiple patterns.

That said, in this case you can check whether the first token of your match is a # or not to tell between your two patterns.

If you really need to differentiate two patterns, then it would be better to add them with different labels.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@polkaYK
Comment options

@polm
Comment options

Answer selected by polkaYK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat / matcher Feature: Token, phrase and dependency matcher
2 participants