diff --git a/pyjosa/exceptions.py b/pyjosa/exceptions.py index db4c8be..854b39e 100644 --- a/pyjosa/exceptions.py +++ b/pyjosa/exceptions.py @@ -1,3 +1,7 @@ class NotHangleException(Exception): def __init__(self): super().__init__("마지막 글자가 한글이 아닙니다.") + +class JosaTypeException(Exception): + def __init__(self): + super().__init__("메서드의 인자로 주어진 조사가 올바르지 않습니다.") \ No newline at end of file diff --git a/pyjosa/josa.py b/pyjosa/josa.py index af4711f..eafef0e 100644 --- a/pyjosa/josa.py +++ b/pyjosa/josa.py @@ -1,5 +1,5 @@ from pyjosa.jonsung import has_jongsung - +from pyjosa.exceptions import JosaTypeException class Josa: @@ -19,7 +19,7 @@ def get_josa(string, josa) -> str: elif (josa == '으로') or (josa == '로'): return '으로' if has_jongsung(string) else '로' else: - raise Exception("올바르지 않은 조사.") + raise JosaTypeException @staticmethod def get_full_string(string, josa) -> str: @@ -37,4 +37,4 @@ def get_full_string(string, josa) -> str: elif (josa == '으로') or (josa == '로'): return string + '으로' if has_jongsung(string) else string + '로' else: - raise Exception("올바르지 않은 조사.") + raise JosaTypeException diff --git a/setup.py b/setup.py index e8d0842..d0411d9 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name = 'pyjosa', - version = '0.0.9', + version = '0.0.10', description = '한국어 조사 처리 패키지', author = 'sehwan.kim', author_email = 'sehwan.kim@ingkle.com',