eshore.cn.it.phrase.TestPhrase.java Source code

Java tutorial

Introduction

Here is the source code for eshore.cn.it.phrase.TestPhrase.java

Source

/*
 * <summary></summary>
 * <author>He Han</author>
 * <email>hankcs.cn@gmail.com</email>
 * <create-date>2014/10/9 16:43</create-date>
 *
 * <copyright file="TestPhrase.java" company="???">
 * Copyright (c) 2003-2014, ???. All Right Reserved, http://www.linrunsoft.com/
 * This source is subject to the LinrunSpace License. Please contact ??? to get more information.
 * </copyright>
 */
package eshore.cn.it.phrase;

import com.hankcs.hanlp.HanLP;
import com.hankcs.hanlp.tokenizer.StandardTokenizer;

import eshore.cn.it.business.PhraseAction;
import junit.framework.TestCase;

import java.io.File;

import org.apache.commons.io.FileUtils;

/**
 * ????
 * @author hankcs
 */
public class TestPhrase extends TestCase {
    static final String FOLDER = "F:\\??\\\\";
    static final PhraseAction action = new PhraseAction();

    public void testExtract() throws Exception {
    }

    public void testSingle() throws Exception {
        HanLP.Config.enableDebug();
        action.setFileName(FOLDER + "\\14?? ????.txt");
        action.phraseAction();
    }

    public void testSeg() throws Exception {
        System.out.println(StandardTokenizer.segment(FileUtils.readFileToString(
                new File(FOLDER + "\\??4000.txt"), "GBK")));
    }
}