-
Notifications
You must be signed in to change notification settings - Fork 0
fix: 필터링 로직 contains->Pattern으로 로직 전면 수정 #258
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
The head ref may contain hidden characters: "fix/#257_\uB3C8\uAE4C\uC2A4\uAE40\uCE58\uB098\uBCA0_\uD544\uD130\uB9C1"
Conversation
Summary of ChangesHello @JjungminLee, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. 정규식의 힘, 메뉴 필터 정교하게, 리뷰는 깔끔히. Footnotes
|
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.
Code Review
contains를 사용하던 기존 필터링 로직을 Pattern과 split을 활용한 방식으로 수정한 것은 정확도를 높이는 좋은 개선입니다. 여러 메뉴가 한 줄에 포함된 경우("돈까스&소바")를 고려하여 각 메뉴를 개별적으로 검사하도록 변경한 점도 훌륭합니다. 다만, 코드의 가독성과 효율성을 높일 수 있는 몇 가지 부분이 있어 리뷰를 남깁니다.
| boolean allExcluded = true; | ||
| for (String item : items) { | ||
| String trimmed = item.trim(); | ||
| if (trimmed.isBlank()) continue; | ||
|
|
||
| if (!isExcludedSingle(trimmed)) { | ||
| allExcluded = false; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| if (menuName.contains("밥") | ||
| && !menuName.contains("자장밥") | ||
| && !menuName.contains("볶음밥") | ||
| && !menuName.contains("비빔밥")) { | ||
| return true; | ||
| } | ||
| return allExcluded; |
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.
| for (String keyword : EXCLUDED_KEYWORDS) { | ||
| if (name.equals(keyword)) return true; | ||
| } |
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.
| if (SINGLE_KIMCHI_PATTERN.matcher(name).find()) return true; | ||
| if (SINGLE_BAP_PATTERN.matcher(name).find()) return true; |
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.
isExcludedFromReview 메소드에서 menuName을 split하고 trim한 결과가 name으로 전달되므로, name은 앞뒤 공백이 없는 단일 단어입니다. 따라서 (^|\s)김치($|\s)와 같은 정규식 패턴은 name.equals("김치")와 동일하게 동작합니다. 불필요한 정규식 사용은 성능 저하를 유발할 수 있으므로, 간단한 equals 비교로 변경하는 것이 좋습니다. 이 변경과 함께 SINGLE_KIMCHI_PATTERN과 SINGLE_BAP_PATTERN 필드는 제거할 수 있습니다.
if (name.equals("김치")) return true;
if (name.equals("밥")) return true;
#️⃣ Issue Number
📝 요약(Summary)
💬 공유사항 to 리뷰어
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.