Package org.chasen.mecab

Examples of org.chasen.mecab.Node


  public void tearDown() throws Exception {
  }

  @Test
  public void testBasicHangulSentence() {
    Node node = mockNodeListFactory(new String[] {
        "진달래\tNNG,*,F,진달래,*,*,*,*,*",
        " 꽃\tNNG,*,T,꽃,*,*,*,*,*",
        "이\tJKS,*,F,이,*,*,*,*,*",
        " 피\tVV,*,F,피,*,*,*,*,*",
        "었\tEP,*,T,었,*,*,*,*,*",
 
View Full Code Here


    assertEquals(null, tokens);
  }
 
  @Test
  public void testDecompound() {
    Node node = mockNodeListFactory(new String[] {
        "삼성전자\tNNP,*,F,삼성전자,Compound,*,*,삼성+전자,삼성/NNG/*/1/1+삼성전자/Compound/*/0/2+전자/NNG/*/1/1",
    });
    TokenGenerator generator =
        new TokenGenerator(new StandardPosAppender(), 1, node);
   
View Full Code Here

    assertEquals(null, tokens);
  }
 
  @Test
  public void testComplexDecompound() {
    Node node = mockNodeListFactory(new String[] {
        "아질산나트륨\tNNG,*,T,아질산나트륨,Compound,*,*,아질산+나트륨," +
        "아/NNG/*/1/1+아질산나트륨/Compound/*/0/3+아질산/NNG/*/0/2+질산/NNG/*/1/1+나트륨/NNG/*/1/1"
    });
    TokenGenerator generator =
        new TokenGenerator(new StandardPosAppender(), 1, node);
View Full Code Here

    assertEquals(null, tokens);
  }
 
  @Test
  public void testNoDecompound() {
    Node node = mockNodeListFactory(new String[] {
        "삼성전자\tNNP,*,F,삼성전자,Compound,*,*,삼성+전자,삼성/NNG/*/1/1+삼성전자/Compound/*/0/2+전자/NNG/*/1/1",
    });
    TokenGenerator generator =
        new TokenGenerator(
            new StandardPosAppender(), TokenGenerator.NO_DECOMPOUND, node);
View Full Code Here

    assertEquals(null, tokens);
  }
 
  @Test
  public void testCompoundNounMinLength4() {
    Node node = mockNodeListFactory(new String[] {
        "무궁화\tNNG,*,F,무궁화,Compound,*,*,무궁+화,무궁/NNG/*/1/1+무궁화/Compound/*/0/2+화/NNG/*/1/1"
    });
    TokenGenerator generator =
        new TokenGenerator(
            new StandardPosAppender(), 4, node);
View Full Code Here

    assertEquals(null, tokens);
  }
 
  @Test
  public void testSentenceWithDecompoundAll() {
    Node node = mockNodeListFactory(new String[] {
        "삼성전자\tNNP,*,F,삼성전자,Compound,*,*,삼성+전자,삼성/NNG/*/1/1+삼성전자/Compound/*/0/2+전자/NNG/*/1/1",
        "는\tJX,*,T,는,*,*,*,*,*",
        " 대표\tNNG,*,F,대표,*,*,*,*,*",
        "적\tXSN,*,T,적,*,*,*,*,*",
        "인\tVCP+ETM,*,T,인,Inflect,VCP,ETM,이/VCP+ㄴ/ETM,*",
 
View Full Code Here

    assertEquals(null, tokens);
  }
 
  @Test
  public void testSentenceWithDecompoundComplexCompoundNoun() {
    Node node = mockNodeListFactory(new String[] {
        "아질산나트륨\tNNG,*,T,아질산나트륨,Compound,*,*,아질산+나트륨,아/NNG/*/1/1+아질산나트륨/Compound/*/0/3+아질산/NNG/*/0/2+질산/NNG/*/1/1+나트륨/NNG/*/1/1",
        "이란\tJX,*,T,이란,*,*,*,*,*",
        "무엇\tNP,*,T,무엇,*,*,*,*,*",
        "인가요\tVCP+EF,*,F,인가요,Inflect,VCP,EF,이/VCP+ㄴ가요/EF,*",
        "?\tSF,*,*,*,*,*,*,*,*",
 
View Full Code Here

    assertEquals(null, tokens);
  }

  @Test
  public void testSentenceWithCompoundNounMinLength4() {
    Node node = mockNodeListFactory(new String[] {
        "나\tNP,*,F,나,*,*,*,*,*",
        "의\tJKG,*,F,의,*,*,*,*,*",
        "무궁화\tNNG,*,F,무궁화,Compound,*,*,무궁+화,무궁/NNG/*/1/1+무궁화/Compound/*/0/2+화/NNG/*/1/1",
        "꽃\tNNG,*,T,꽃,*,*,*,*,*",
        "을\tJKO,*,T,을,*,*,*,*,*",
 
View Full Code Here

    assertEquals(null, tokens);
  }
 
  @Test
  public void testSentenceWithEnglishAndSymbols() {
    Node node = mockNodeListFactory(new String[] {
        "영어\tNNG,*,F,영어,*,*,*,*,*",
        "(\tSSO,*,*,*,*,*,*,*,*",
        "english\tSL,*,*,*,*,*,*,*,*",
        ")\tSSC,*,*,*,*,*,*,*,*",
        "를\tJKO,*,T,를,*,*,*,*,*",
 
View Full Code Here

    assertEquals(null, tokens);
  }

  @Test
  public void testPreanaysis() {
    Node node = mockNodeListFactory(new String[] {
        "은전한닢\tNNG+NR+NNG,*,T,은전한닢,Preanalysis,NNG,NR,은전+한+닢,은전/NNG/*/1/1+한/NR/*/1/1+닢/NNG/*/1/1",
    });

    TokenGenerator generator =
        new TokenGenerator(new StandardPosAppender(), 4, node);
View Full Code Here

TOP

Related Classes of org.chasen.mecab.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.