fix: Kiwi v0.23.0 지원 및 Functional Options 패턴 적용 (Resolves #41)#42
Open
kkweon wants to merge 5 commits into
Open
fix: Kiwi v0.23.0 지원 및 Functional Options 패턴 적용 (Resolves #41)#42kkweon wants to merge 5 commits into
kkweon wants to merge 5 commits into
Conversation
This commit addresses the API breaking changes introduced in Kiwi v0.23.0 where new parameters like `enabled_dialects` and structs like `kiwi_analyze_option_t` were introduced. To resolve compilation failures and provide a clean idiomatic Go interface, the API was refactored to use the Functional Options pattern. Changes include: - Updated Makefile to download Kiwi v0.23.0 - Refactored `New` and `NewBuilder` to use `Option` callbacks. - Refactored `Analyze` to use `AnalyzeOptionFunc` callbacks, defaulting TopN to 1. - Updated all test cases to reflect the new API and new model scoring weights.
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.
개요 (Overview)
이 PR은 #41 이슈를 해결하기 위해 작성되었습니다.
Kiwi C 라이브러리가 v0.23.0으로 업데이트되면서 발생한 API 호환성 문제(함수 시그니처 불일치)를 수정하고, Go 라이브러리의 사용성을 개선하기 위해 코드를 리팩토링했습니다.
변경 사유 및 상세 내용 (Why & What)
Kiwi v0.23.0 C API 호환성 대응
kiwi_init및kiwi_builder_init함수에enabled_dialects매개변수가 추가됨에 따라, C 호출 시 해당 인자를 전달하도록 수정했습니다.kiwi_analyze함수가 단순int형태의 옵션 대신kiwi_analyze_option_t구조체를 받도록 변경되었습니다. 이에 맞춰 내부적으로 C 구조체를 생성하여 전달하도록 수정했습니다.Functional Options 패턴 도입
1,3.0,2.5)를 호출부에서 강제하게 됩니다.opts ...Option)을 적용하여 기본 유스케이스는 최대한 단순하게 유지하면서, 고급 기능이 필요한 사용자는WithTopN(),WithNumThread(),WithDialect()등을 통해 유연하게 설정할 수 있도록 리팩토링했습니다.테스트 및 Makefile 버그 수정
models/cong/base/하위 경로로 풀리는 문제를 해결하여,make test시 매번 모델을 다시 다운로드하지 않고 정상적으로 캐싱되도록Makefile을 수정했습니다.관련 이슈