Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
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
Broken title search ut #411
Broken title search ut #411
Changes from 3 commits
0db661c
092e7c4
013afde
669988b
533fe9a
145af72
5ff4022
c23161e
88671f7
dae344e
5f86258
a66b68f
6aca298
5d8e38c
281a849
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regex is closely coupled to
DocDetails
. Can you move this regex to aClassVar[str]
onDocDetails
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you got the capturing groups wrong, you want
r"This article has (\d+) citations?"
We don't care to extract the text, we want to extract the number
Then you can just directly compare the
int
, no need for the weirdr"\1n\2"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair.
This original approach using
\1n\2
was because it's focusing on comparing the structure of the citation text while ignoring the citation count itself; just ignoring whatever number is there.But you make a valid point. I'll get this updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw (I am not sure your experience levels with regex) going from
r"(This article has )\d+( citations?)"
tor"This article has (\d+) citations?"
will still match the surrounding text too. A capturing group()
is here to make it easy to capture and extract a valueAnd plz point out if we're on the same page already haha. Hope you have a good night
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe I've addressed this accordingly. Thx James!