Package org.ictclas4j.segment

Examples of org.ictclas4j.segment.Segment


      jbSplitOK.setText("�ִ�");
      jbSplitOK.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          int segPathCount = Integer.parseInt(jtSegPathCount.getText());
          DictLib dictLib=SegMain.dictLib;
          Segment seg=new Segment(dictLib,segPathCount);
          seg.setOutputMidResult(true);
          seg.setRecogniseUnknown(true);
          SegResult sr = seg.split(jtSrcMsg.getText());
          jtSplitMsg.setText( sr.toString());
        }
      });
    }
    return jbSplitOK;
View Full Code Here


        public void actionPerformed(java.awt.event.ActionEvent e) {
          try {
            long bytes = 0;
            int segPathCount = Integer.parseInt(jtSegPathCount.getText());
            DictLib dictLib=SegMain.dictLib;
            Segment seg=new Segment(dictLib,segPathCount);
            int forCount = Integer.parseInt(jtFor.getText());
            ArrayList<String> testCases = GFFile.readTxtFile2("test"+GFFinal.FILE_SEP+"case1.txt");
           
            long times=System.currentTimeMillis();
            for (int i = 0; i < forCount; i++) {
              for (String src : testCases) {
                SegResult sr =seg.split(src);
                bytes += src.getBytes().length;
                jtSplitMsg.setText(sr.toString());
              }
            }
           
View Full Code Here

    // first, read from cache
    result = dictLib.getCachedSeg(content);
    // then,segment factly
    if (result == null) {
      Segment seg = new Segment(dictLib, 1);
      seg.setOutputMidResult(true);
      seg.setRecogniseUnknown(true);
      result = seg.split(content);

      // cache it
      if (result != null) {
        dictLib.addCachedSeg(content, result);
      }
View Full Code Here

  }

  public static void main(String[] args) {
    SegMain sm = new SegMain();
    seg = new Segment(1);
     sm.initFrm();
//    String[] source = {
//        "2006��¹����籭�˷�֮һ��������Ҫ��ʼ",
//        "���ݣ����羯�조Ѳ�ߡ�BBS�Ͳ���",
//        "18ʱ42�ֵ�������Ҫ��ʼ��",
View Full Code Here

    try {
      long bytes = 0;
      int segPathCount = 1;
      int forCount = 1;
      DictLib dictLib = new DictLib();
      Segment seg = new Segment(dictLib, segPathCount);
      ArrayList<String> testCases = GFFile.readTxtFile2("test" + GFFinal.FILE_SEP + "case1.txt");

      long times = System.currentTimeMillis();
      for (int i = 0; i < forCount; i++) {
        for (String src : testCases) {
          SegResult sr = seg.split(src);
          bytes += src.getBytes().length;
          //��ӡ����Ἣ���Ӱ���ٶ�
//          System.out.println(sr);
        }
      }
View Full Code Here

    // ��ʼ����ť
    initActions();
    // ��ʼ���ļ�ѡ����
    initFc();
   
    seg = new Segment(1);
   
    frame.setVisible(true);
  }
View Full Code Here

    initOntology();

    initPatterns();

    seg = new Segment(1);

    frame.setVisible(true);
  }
View Full Code Here

  }

  public static void main(String[] args) {
//    SegMain sm = new SegMain();
    seg = new Segment(1);
//     sm.initFrm();
     String[] source = { "�ҵĹ�������һ��Ӱ¥����ױʦ���ص�λ�ڻƽ�ضΣ���Ϊ�Ҿ����������ϰ�����վ�������ɵ�����ʷ�Ϊ�������ʺ���������֣���������һ�㣬���ݹ������ͼ����ȼ�����ռ��ͷ�����ڹ˿ʹ���ĩ�пգ���һ������Ƚ����У���ĩ��æ����Ҫ�Ӱ࣬����ͨ����һ��Ϣ��" };
    for (int i = 0; i < source.length; i++) {
      SegResult sr = seg.split(source[i]);
      System.out.println("time:" + sr.getSpendTime() + " "
View Full Code Here

TOP

Related Classes of org.ictclas4j.segment.Segment

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.