Code Monkey home page Code Monkey logo

twitter-korean-py's Introduction

twitter-korean-py

PyPI index

Circle CI Build Status

Travis CI Build Status

twitter-korean-pytwitter-korean-text 의 스칼라 코드를 참고하여 파이썬으로 새로 코딩하여 포팅한 라이브러리입니다.

  • 현재는 정규화(normalizer)만 가능하며, 나머지 기능(토큰화, 어근화, 어구 추출)은 아직 구현하지 않았습니다.
  • JPype 를 사용한 래퍼 인터페이스인 twkorean 과는 달리, twitter-korean-text의 스칼라/자바 코드를 사용하지 않은 순수 파이썬(pure-python) 코드입니다.
  • 설치 스크립트는 twitter-korean-text의 maven repository에서 JAR 파일을 다운받은 후, 사전 파일만을 압축 해제하여 사용합니다.
    • 이 개념은 twkorean을 참고하였습니다.
    • 파이썬 2.7에서는 maven-artifact 라는 툴을 사용하여 maven 없이 설치 가능합니다.
    • 파이썬 3.x에서는 maven(mvn)을 직접 실행해서 다운로드합니다.

Usage Example

>>> import twitter_korean
>>> text = u"한국어를 처리하는 예시입니닼ㅋㅋㅋㅋㅋ #한국어"
>>> # Normalize
>>> normalized = twitter_korean.normalize(text)
>>> print(normalized)
한국어를 처리하는 예시입니다ㅋㅋ #한국어
>>> # Tokenize
>>> tokens = twitter_korean.tokenize(normalized)
Traceback (most recent call last):
NotImplementedError: ...
>>> tokens = [(u'한국어', 'Noun', 0, 3), (u'를', 'Josa', 3, 1), (u' ', 'Space', 4, 1), (u'처리', 'Noun', 5, 2), (u'하는', 'Verb', 7, 2), (u' ', 'Space', 9, 1), (u'예시', 'Noun', 10, 2), (u'입니', 'Adjective', 12, 2), (u'다', 'Eomi', 14, 1), (u'ㅋㅋ', 'KoreanParticle', 15, 2), (u' ', 'Space', 17, 1), (u'#한국어', 'Hashtag', 18, 4)]
>>> # Stemming
>>> stemmed = twitter_korean.stem(tokens)
Traceback (most recent call last):
NotImplementedError: ...
>>> # Phrase extraction
>>> phrases = twitter_korean.extract_phrases(tokens)
Traceback (most recent call last):
NotImplementedError: ...

Running Tests

유닛 테스트 라이브러리는 BDD testing framework인 mamba 를 사용했습니다.

명령행에서 mamba spec/*.py 를 실행하시면 됩니다.

현재까지 구현된 내용에 대한 테스트 코드는 spec/KoreanNormalizerTest.py 입니다.

twitter-korean-py's People

Contributors

hohyon-ryu avatar bikim avatar cedar101 avatar caniszczyk avatar retrieverjo avatar jun85664396 avatar bistros avatar jhsbeat avatar keepcosmos avatar stray-leone avatar

Watchers

 avatar

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.