Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature(#232) to split Inflect type words of mecab #341

Merged
merged 5 commits into from
Jan 9, 2022

Conversation

kwonmha
Copy link
Contributor

@kwonmha kwonmha commented Dec 15, 2020

예전에 제가 제기했던 이슈 #232 를 구현하여 PR 드립니다.


목표 :

현재 konlpy.tag의 Mecab을 불러와서 형태소 분석을 하면
'힘든 하루였다'란 문장을
[('힘든', 'VA+ETM'), ('하루', 'NNG'), ('였', 'VCP+EP'), ('다', 'EC')]
이렇게 표기합니다.

이를
[('힘들', 'VA'), ('ㄴ', 'ETM'), ('하루', 'NNG'), ('이', 'VCP'), ('었', 'EP'), ('다', 'EC')]
로 볼 수 있는 옵션을 추가했습니다.

mecab.pos('힘든 하루였다', split_inflect=True)


구현:

mecab에서 이미 inflect type 단어를 형태소로 나누어 따로 표기해줍니다.

힘든	VA+ETM,*,T,힘든,Inflect,VA,ETM,힘들/VA/*+ᆫ/ETM/*
하루	NNG,*,F,하루,*,*,*,*
였	VCP+EP,*,T,였,Inflect,VCP,EP,이/VCP/*+었/EP/*
다	EC,*,F,다,*,*,*,*

그래서 필요한 부분을 추출해서 썼습니다.

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 56.0% when pulling 5cef6d4 on kwonmha:mecab-split-inflect into 5f7c93f on konlpy:master.

@kwonmha
Copy link
Contributor Author

kwonmha commented May 24, 2021

안녕하세요.
오래 전에 풀 리퀘스트를 남겼는데, 리뷰가 없어서 댓글 남겨 봅니다.

@AnneUK
Copy link

AnneUK commented Jun 11, 2021

이 기능이 있으면 좋겠습니다.

kwonmha님 고맙습니다, 잘 사용하겠습니다

@kwonmha
Copy link
Contributor Author

kwonmha commented Oct 12, 2021

pr #360 의 수정사항을 반영했습니다.
해당 이슈의 변수명이 영어 문법과 맞지 않아 수정해봤습니다.

이전 버전의 pr에서 같은 함수 내에서 리턴형식이 달랐던 부분을 수정했습니다.
테스트 coverage도 같이 높아질 것 같습니다.

@e9t
Copy link
Member

e9t commented Jan 9, 2022

LGTM! 감사합니다.

@e9t e9t merged commit d920630 into konlpy:master Jan 9, 2022
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.

None yet

4 participants