We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is the output of the matches from the matcher at chapter1_03_rule-based-matching.md Matching lexical attributes, but the implementation to get it is missing.
doc = nlp("2018 FIFA World Cup: France won!")
(The implementation is missing to output the following 2018 FIFA World Cup: from doc.
2018 FIFA World Cup:
doc
Add the implementation to get the output. The following code is one of the candidate.
matcher = Matcher(nlp.vocab) matcher.add("IPHONE_PATTERN", None, pattern) matches = matcher(doc) for match_id, start, end in matches: matched_span = doc[start:end] print(matched_span.text)
But a little verbose. We can avoid the repetition of the code by function.
def print_matches(doc, pattern); matcher = Matcher(nlp.vocab) matcher.add("PATTERN", None, pattern) matches = matcher(doc) for match_id, start, end in matches: matched_span = doc[start:end] print(matched_span.text)
Then, we can write as following.
doc = nlp("2018 FIFA World Cup: France won!") print_matches(doc, pattern)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Phenomenon
There is the output of the matches from the matcher at chapter1_03_rule-based-matching.md Matching lexical attributes, but the implementation to get it is missing.
(The implementation is missing to output the following
2018 FIFA World Cup:
fromdoc
.Proposal
Add the implementation to get the output. The following code is one of the candidate.
But a little verbose. We can avoid the repetition of the code by function.
Then, we can write as following.
The text was updated successfully, but these errors were encountered: