node-twitter-korean-text
Nodejs interface to twitter-korean-text via node-java
Dependency
Currently wraps twitter-korean-text 4.4.4
현재 이 프로젝트는 twitter-korean-text 4.4.4을 사용중입니다.
Requirement
Since it uses java code compiled with Java 8, make sure you have both Java 8 JDK and JRE installed.
For more details about installing java interface, see installation notes on node-java.
이 프로젝트는 Java 8로 컴파일된 코드를 사용하기 때문에, Java 8 JDK/JRE가 설치되어 있어야 합니다.
Java interface의 설치에 관련된 더 자세한 사항은 이곳 에서 확인하세요.
Installation
npm install --save node-twitter-korean-text
Usage
Support both asynchronous(default) and synchronous way.
const TwitterKoreanProcessor = ; // NormalizeTwitterKoreanProcessor; // Tokenize// tokensToJsonArray(tokens, keepSpace = false) TwitterKoreanProcessor; // StemmingTwitterKoreanProcessor ; // Add to dictionaryTwitterKoreanProcessor ; TwitterKoreanProcessorTwitterKoreanProcessor ; // Phrase extraction// extractPhrases(tokens, filterSpam = true, includeHashtags = true) TwitterKoreanProcessor; // Splitting SentenceTwitterKoreanProcessor ; // DetokenizeTwitterKoreanProcessor;
Synchronous way
just append Sync at the end of each methods
const TwitterKoreanProcessor = ; // Normalizeconst normalized = TwitterKoreanProcessor; // '힘들겠습니다 그래요ㅋㅋ' // Tokenize// tokensToJsonArray(tokens, keepSpace = false) const tokens = TwitterKoreanProcessor;const tokenWithSpace = TwitterKoreanProcessor;// [// { 'text': '착한', 'koreanPos': 'Adjective', 'offset': 0, 'length': 2, 'isUnknown': false },// { 'text': '강아지', 'koreanPos': 'Noun', 'offset': 2, 'length': 3, 'isUnknown': false },// { 'text': '상', 'koreanPos': 'Suffix', 'offset': 5, 'length': 1, 'isUnknown': false },// { 'text': '을', 'koreanPos': 'Josa', 'offset': 6, 'length': 1, 'isUnknown': false },// { 'text': ' ', 'koreanPos': 'Space', 'offset': 7, 'length': 1, 'isUnknown': false },// { 'text': '받은', 'koreanPos': 'Verb', 'offset': 8, 'length': 2, 'isUnknown': false },// { 'text': ' ', 'koreanPos': 'Space', 'offset': 10, 'length': 1, 'isUnknown': false },// { 'text': '루루', 'koreanPos': 'Noun', 'offset': 11, 'length': 2, 'isUnknown': false }// ] ...