ICTCLASAnalyzer.java
上传用户:cctqzzy
上传日期:2022-03-14
资源大小:12198k
文件大小:1k
- package chapter8;
- //package com.xjt.nlp.word;
- public class ICTCLASAnalyzer {
- private static ICTCLASAnalyzer instance=null;
- private ICTCLASAnalyzer() {
- //第一个参数0(词语切分),1(一级标注),2(二级标注).
- //第二个参数0(北大标准),1(973标准),2(XML).
- init(0,0);
- }
- public synchronized static ICTCLASAnalyzer getInstance(){
- if (instance==null){
- instance = new ICTCLASAnalyzer();
- }
- return instance;
- }
- public synchronized native boolean init(int i, int j);
- public synchronized native String paragraphProcess(String sParagraph);
- public synchronized native boolean fileProcess(String source,String target);
-
- public static void main(String[] args) {
- ICTCLASAnalyzer split1 = new ICTCLASAnalyzer();
- System.out.println("下边要处理的文本大小为48M");
- long startTime=System.currentTimeMillis();
- split1.fileProcess("c:\1.txt","c:\2.txt");
- long endTime=System.currentTimeMillis();
- System.out.println(endTime-startTime);//时间为毫妙
- }
- // public static {
- // System.loadLibrary("ICTCLAS");
- // }
- }