-
Notifications
You must be signed in to change notification settings - Fork 5
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
Find command update #75
Find command update #75
Conversation
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.
Looks good, just one minor issue
@@ -18,7 +16,10 @@ public AnswerContainsKeywordsPredicate(List<String> keywords) { | |||
@Override | |||
public boolean test(QAndA qAndA) { | |||
return keywords.stream() | |||
.anyMatch(keyword -> StringUtil.containsWordIgnoreCase(qAndA.getAnswer().answer, keyword)); | |||
.anyMatch(keyword -> { | |||
System.out.println("current keyword is: " + keyword); |
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.
Extra print statement?
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.
Great job!
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.
Looks good!
Context:
Q1: What is diabetes?
Tag: Chronic Diseases, Immunology
A1: Body unable to regulate blood sugar level
Q2: asdas
Tag: Nervous System, Immunology
A2: help
Q3: hehe
Tag: Immune System
A3: helpppppp
What needed fixing
find a/help
expected: return question 2 & 3
actual: returned all 3 questions
Why: Turns out, parser split a/help -> [a, help], and checked each answer to see if it contains "a" (resulted in Q1 being added).
Fixed: Parsed only the [help] into the predicates. Changes also made for find q/ and find t/.
close #76