python)영어 문장에서 명사 판별하는 좋은 방법이 뭘까요?

조회수 1061회

파이썬을 사용하고 있습니다. 바로 질문 드릴게요!

text = '''Manchester City won the Under-18 Premier League Cup for a second successive season after beating Stoke City 6-0 at Academy Stadium.
Stoke had knocked out 2017/18 winners Chelsea to reach the final for the first time but went behind to Samuel Edozie's deflected 39th-minute opener.
Man City then hit five goals in 15 second-half minutes.
Liam Delap netted a stunning solo goal before James Mcatee and captain Cole Palmer, pictured above lifting the Trophy, both struck braces.'''

위에 있는 text 변수에는 영문이 저장 되어 있습니다. text 변수에서 명사만 잡아내고 싶습니다. 그래서 명사 데이터를 영문사전에서 크롤하여 데이터베이스에 크롤하고 있는데, 이런 방법 말고 손쉽게 명사 정보를 담고 있는 api나 파이썬 라이브러리 같은 게 있을까요?

test = 위와같은 영어문장 초기화
eng_list = test.split(" ")
for word in eng_list:
    if word == 명사:
        print("이 단어는 명사입니다.")

간단하게 이런 식으로라도 명사인지 아닌지 판별할 수 있을까요?

3 답변

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)