refactor(normalizer): TextNormalizer를 Normalizer 상속에서 분리 (#257) - #274
Merged
Conversation
- Normalizer: ABC로 전환, normalize()를 @AbstractMethod로 명시 - TextNormalizer: Normalizer 상속 제거 — 컴포지트 패턴 역할 명확화 - __call__, normalize 메서드 직접 구현 - normalizer_list 타입 힌트를 list[Callable[[str], str]]로 명시 - 동작 변경 없음, 기존 import 경로 그대로 유지 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Mar 10, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Normalizer클래스를ABC로 전환하고normalize()를@abstractmethod로 명시TextNormalizer에서Normalizer상속 제거 — 여러 normalizer를 조합하는 컴포지트 패턴임을 클래스 계층으로 명확히 표현__call__,normalize메서드를 직접 구현normalizer_list타입 힌트list[Callable[[str], str]]으로 명시화Background
TextNormalizer는 개별 정규화 규칙을 구현하는Normalizer가 아니라, 여러 normalizer를 순차 적용하는 컴포지트이다. 이를Normalizer로부터 분리하여 의미적 명확성을 높인다.Closes #257
Test plan
uv run pytest tests/unit/test_normalizer.py— 17 passeduv run pre-commit run --all-files— all passed🤖 Generated with Claude Code