Git Product home page Git Product logo

pyjosa's Introduction

Pyjosa

PyPI PyPI - Python Version GitHub GitHub Workflow Status (branch)

PyPI - Downloads

입력받은 한글 문자에 종성이 있을경우, 없을 경우를 구분하여 을/를, 이/가와 같은 조사를 자동으로 반환하거나 붙여주는 패키지

PyPI에 배포 하였음. 현재 버전 PyPI

공식 도큐먼트

https://kimsehwan96.github.io/pyjosa/

설치

python3 -m pip install pyjosa -U

혹은

pip3 install pyjosa

사용법

from pyjosa.josa import Josa

print(Josa.get_josa("철수", "은")) # 는
print(Josa.get_josa("오리", "을")) # 를
print(Josa.get_josa("닭", "는")) # 은
print(Josa.get_josa("산", "으로")) # 으로
print(Josa.get_josa("명예", "과")) # 와
print(Josa.get_josa("물", "나")) # 이나
# 사람 이름 + 이가/가 를 구분하기 위해서는 조사부분에 '이가'를 입력합니다.
print(Josa.get_josa("예나", "이가")) # 가
print(Josa.get_josa("세환", "이가")) # 이가

print(Josa.get_full_string("철수", "은")) # 철수는
print(Josa.get_full_string("오리", "을")) # 오리를
print(Josa.get_full_string("닭", "는")) # 닭은
print(Josa.get_full_string("산", "으로")) # 산으로
print(Josa.get_full_string("명예", "과")) # 명예와
print(Josa.get_full_string("물", "나")) # 물이나
# 사람 이름 + 이가/가 를 구분하기 위해서는 조사부분에 '이가'를 입력합니다.
print(Josa.get_full_string("예나", "이가")) # 예나가
print(Josa.get_full_string("세환", "이가")) # 세환이가

지원되는 조사 목록

https://kimsehwan96.github.io/pyjosa/3_%EC%A7%80%EC%9B%90%EB%90%98%EB%8A%94_%EC%A1%B0%EC%82%AC/

  1. 을 / 를
  2. 은 / 는
  3. 이 / 가
  4. 과 / 와
  5. 이나 / 나
  6. 으로 / 로
  7. 아 / 야
  8. 이랑 / 랑
  9. 이며 / 며
  10. 이다 / 다
  11. 이가 / 가

Core Concept

주어진 한글 단어의 마지막 글자의 종성 여부를 구분합니다.

종성 여부에 따라서 올바른 조사 문자를 반환하거나, 조사를 붙인 문자열을 반환합니다.

Release

v1.0.0

최초 릴리즈

v1.0.1

'이가' 구분 추가

v1.0.2

  • 아/야
  • 이랑/랑
  • 이며/며
  • 이다/다

4개 조사 추가

퍼포먼스

기존에 잘 만들어 두신 조사처리 패키지 : https://github.com/myevan/pyjosa 와의 성능 테스트 결과

4.704572초 걸렸습니다.  : https://github.com/kimsehwan96/pyjosa
5.381061초 걸렸습니다.  : https://github.com/myevan/pyjosa

테스트 코드 :

https://github.com/kimsehwan96/pyjosa/blob/master/performance_test.py

Contribute

pyjosa's People

Contributors

kimsehwan96 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

starldg

pyjosa's Issues

Exception 을 커스텀 해야 함

def has_jongsung(string: str)  -> bool:
    if not is_hangle(string):
        raise Exception("마지막 글자가 한글이 아닙니다.")

이 부분에서 raise Exception으로 처리하게 되면, 실제 사용자가 이 부분을 예외처리 하기위해서

try:
    # logic here 
except Exception as e:
    # logic here

과 같이 Exception을 예외처리 해야 하므로 , custom Exception Class를 만들어서 런타임 에러를 만들어야 함.

조사 분류

이/가
을/를
은/는

등 어떤 조사들을 어떻게 분류할지 정리해서 기능 제공

브랜치 전략 결정

dev / master (release 용) 으로 분리해서 git flow를 따르기?

기타 좋은 방법?

클라이언트가 사용할 API 네이밍 길이 조절

현재 get_josaget_full_string 과 같이 긴 메서드명을 사용해서 불편함을 끼칠 수 있음.

다른 비슷한 기능을 하는 라이브러리를 찾아본 결과 pick 과 같이 짧은 메서드명을 사용함.

하지만 메서드명을 이렇게 바꿔서 배포하면 하위호환을 유지할 수 없음. 하위 호환을 유지하면서 새로운 메서드명을 적용할 방법을 고안해야 함

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.