Skip to content

Conversation

@JjungminLee
Copy link
Collaborator

#️⃣ Issue Number

📝 요약(Summary)

💬 공유사항 to 리뷰어

✅ PR Checklist

PR이 다음 요구 사항을 충족하는지 확인하세요.

  • 커밋 메시지 컨벤션에 맞게 작성했습니다.
  • 변경 사항에 대한 테스트를 했습니다.(버그 수정/기능에 대한 테스트).

@JjungminLee JjungminLee self-assigned this Oct 4, 2025
@JjungminLee JjungminLee added the fix 고치기 label Oct 4, 2025
@gemini-code-assist
Copy link

Summary of Changes

Hello @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은 MenuFilterUtil 클래스의 메뉴 필터링 로직을 재구성하여, 기존의 단순 문자열 포함 여부 확인 방식의 한계를 극복하고 정규 표현식을 통해 더욱 정교하고 유연한 필터링을 가능하게 합니다. 이는 특히 복합 메뉴 이름이나 여러 메뉴가 함께 나열된 경우에 필터링의 정확성을 높이는 것을 목표로 합니다.

Highlights

  • 필터링 로직 개선: 메뉴 필터링 로직이 기존의 contains 방식에서 정규 표현식(Pattern)을 활용하는 방식으로 전면 수정되었습니다.
  • 다중 메뉴 항목 처리: 하나의 문자열에 여러 메뉴 항목이 포함된 경우(예: '메뉴1 + 메뉴2')를 처리하기 위해 입력 문자열을 분리하여 각 항목을 개별적으로 필터링하도록 변경되었습니다.
  • 정확한 '김치' 및 '밥' 필터링: 단독 '김치'와 '밥'을 정확하게 필터링하기 위한 SINGLE_KIMCHI_PATTERNSINGLE_BAP_PATTERN 정규 표현식이 추가되어, '김치볶음밥'이나 '자장밥'과 같은 복합 메뉴가 잘못 필터링되는 것을 방지합니다.
  • 헬퍼 메서드 도입: 단일 메뉴 항목의 제외 여부를 확인하는 isExcludedSingle 프라이빗 헬퍼 메서드가 도입되어 코드의 가독성과 재사용성이 향상되었습니다.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@JjungminLee JjungminLee linked an issue Oct 4, 2025 that may be closed by this pull request
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

contains를 사용하던 기존 필터링 로직을 Patternsplit을 활용한 방식으로 수정한 것은 정확도를 높이는 좋은 개선입니다. 여러 메뉴가 한 줄에 포함된 경우("돈까스&소바")를 고려하여 각 메뉴를 개별적으로 검사하도록 변경한 점도 훌륭합니다. 다만, 코드의 가독성과 효율성을 높일 수 있는 몇 가지 부분이 있어 리뷰를 남깁니다.

Comment on lines 25 to 36
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;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

이 로직은 Java Stream API를 사용하면 더 간결하고 선언적으로 표현할 수 있습니다. for 루프 대신 allMatch를 사용하면 모든 항목이 제외 대상인지 확인하는 의도를 더 명확하게 드러낼 수 있습니다. 코드 상단에 import java.util.Arrays;를 추가해야 합니다.

        return Arrays.stream(items)
                .map(String::trim)
                .filter(s -> !s.isBlank())
                .allMatch(MenuFilterUtil::isExcludedSingle);

Comment on lines 40 to 42
for (String keyword : EXCLUDED_KEYWORDS) {
if (name.equals(keyword)) return true;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

EXCLUDED_KEYWORDSSet 자료구조이므로, for 루프를 통해 모든 원소를 순회하는 것보다 contains() 메소드를 사용하는 것이 더 효율적입니다. Set.contains()의 시간 복잡도는 평균적으로 O(1)인 반면, 루프는 O(n)입니다.

        if (EXCLUDED_KEYWORDS.contains(name)) return true;

Comment on lines +44 to +45
if (SINGLE_KIMCHI_PATTERN.matcher(name).find()) return true;
if (SINGLE_BAP_PATTERN.matcher(name).find()) return true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

isExcludedFromReview 메소드에서 menuNamesplit하고 trim한 결과가 name으로 전달되므로, name은 앞뒤 공백이 없는 단일 단어입니다. 따라서 (^|\s)김치($|\s)와 같은 정규식 패턴은 name.equals("김치")와 동일하게 동작합니다. 불필요한 정규식 사용은 성능 저하를 유발할 수 있으므로, 간단한 equals 비교로 변경하는 것이 좋습니다. 이 변경과 함께 SINGLE_KIMCHI_PATTERNSINGLE_BAP_PATTERN 필드는 제거할 수 있습니다.

        if (name.equals("김치")) return true;
        if (name.equals("밥")) return true;

@JjungminLee JjungminLee merged commit b746030 into develop Oct 4, 2025
@JjungminLee JjungminLee deleted the fix/#257_돈까스김치나베_필터링 branch October 4, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix 고치기

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: 돈까스김치나베 메뉴 필터링 되는 문제 수정

2 participants