Skip to content

feat(postagger): __repr__ 및 is_trained 추가 - #244

Merged
lovit merged 1 commit into
refactor-2026-postaggerfrom
feature/236
Mar 9, 2026
Merged

feat(postagger): __repr__ 및 is_trained 추가#244
lovit merged 1 commit into
refactor-2026-postaggerfrom
feature/236

Conversation

@lovit

@lovit lovit commented Mar 9, 2026

Copy link
Copy Markdown
Owner

관련 이슈

closes #236

변경 내용

postagger 주요 클래스에 상태 가시성을 추가한다.

Dictionary

>>> repr(dictionary)
"Dictionary(num_tags=4, num_words=14, tags=['Noun', 'Verb', 'Josa', 'Adverb'])"

BaseTagger / SimpleTagger

>>> repr(tagger)
"SimpleTagger(generator=EojeolTemplateMatcher, evaluator=SimpleEojeolEvaluator, postprocessor=None)"

LRMaxScoreTagger

>>> tagger = LRMaxScoreTagger()
>>> tagger.is_trained   # False (lrgraph 없음)
>>> repr(tagger)
"LRMaxScoreTagger(trained=False, vocab_size=0, lrgraph_lmax=12, lrgraph_rmax=8)"
>>> tagger.pos("나는")   # 미학습 경고 로그 출력

POSExtractor

>>> extractor = POSExtractor()
>>> extractor.is_trained   # False
>>> repr(extractor)
"POSExtractor(trained=False, l_max_length=10, r_max_length=8)"

🤖 Generated with Claude Code

- dictionary.py: Dictionary.__repr__ 추가 (tag 목록, 단어 수)
- tagger.py: BaseTagger.__repr__ 추가 (generator, evaluator, postprocessor 타입)
- lrtagger.py: LRMaxScoreTagger.is_trained 프로퍼티, __repr__ 추가, 미학습 시 경고 로깅
- pos_extractor.py: POSExtractor.is_trained 프로퍼티, __repr__ 추가
- test_postagger.py: repr/is_trained 관련 테스트 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lovit
lovit merged commit 736a657 into refactor-2026-postagger Mar 9, 2026
2 checks passed
@lovit
lovit deleted the feature/236 branch March 10, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant