Examples of Segment


Examples of org.gbcpainter.geom.Segment

      /* JUNCTION */
      final Point elementPosition = ( (Junction) element ).getPosition();
      final Set<Pipe> connectedEdges = graph.edgesOf( (Junction) element );
      assert ! connectedEdges.isEmpty();
      for (final Pipe edge : connectedEdges) {
        Segment geomEdge = edge.getSegment();
        Point otherPoint = geomEdge.getA();
        if ( otherPoint.equals( elementPosition ) ) {
          otherPoint = geomEdge.getB();
        }

        boolean isCandidate = false;
        switch ( direction ) {
          case LEFT:
View Full Code Here

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

Examples of org.ictclas4j.segment.Segment

        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

Examples of org.ictclas4j.segment.Segment

    // 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

Examples of org.ictclas4j.segment.Segment

  }

  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

Examples of org.ictclas4j.segment.Segment

    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

Examples of org.jboss.dna.graph.properties.Path.Segment

            // If the contribution is a placeholder contribution, then the children should be merged into other children ...
            if (contribution.isPlaceholder()) {
                // Iterate over the children and add only if there is not already one ...
                Iterator<Segment> childIterator = contribution.getChildren();
                while (childIterator.hasNext()) {
                    Segment child = childIterator.next();
                    if (!childNames.containsKey(child.getName())) {
                        childNames.put(child.getName(), 1);
                        children.add(pathFactory.createSegment(child.getName()));
                    }
                }

            } else {
                // Copy the children ...
                Iterator<Segment> childIterator = contribution.getChildren();
                while (childIterator.hasNext()) {
                    Segment child = childIterator.next();
                    int index = Path.NO_INDEX;
                    Integer previous = childNames.put(child.getName(), 1);
                    if (previous != null) {
                        int previousValue = previous.intValue();
                        // Correct the index in the child name map ...
                        childNames.put(child.getName(), ++previousValue);
                        index = previousValue;
                    }
                    children.add(pathFactory.createSegment(child.getName(), index));
                }

                // Copy the properties ...
                Iterator<Property> propertyIterator = contribution.getProperties();
                while (propertyIterator.hasNext()) {
View Full Code Here

Examples of org.jboss.dna.graph.property.Path.Segment

        assert actualLocation != null;
        Path path = actualLocation.getPath();
        // Get the names of the children ...
        List<MapNode> children = node.getChildren();
        for (MapNode child : children) {
            Segment childName = child.getName();
            Path childPath = pathFactory.create(path, childName);
            request.addChild(childPath, propertyFactory.create(DnaLexicon.UUID, child.getUuid()));
        }
        request.setActualLocationOfNode(actualLocation);
        setCacheableInfo(request);
View Full Code Here

Examples of org.jitterbit.integration.data.structure.text.Segment

        buttons.add(3, new KongaButton(copySegmentAction));
        return buttons;
    }

    private void showFieldDialog(int rowIndex) {
        Segment segment = getSegment(rowIndex);
        if (segment != null) {
            if (SegmentFieldDialog.show(segment, isFixedWidth, isReadOnly())) {
                // The field definition was changed. Fire a property
                // change event.
                fireTableContentsChanged();
View Full Code Here

Examples of org.jpedal.jbig2.segment.Segment

    if (JBIG2StreamDecoder.debug)
      System.out.println("noOfReferredToSegments = " + noOfReferredToSegments);

    for (int i = 0; i < noOfReferredToSegments; i++) {
      Segment seg = decoder.findSegment(referredToSegments[i]);
      int type = seg.getSegmentHeader().getSegmentType();

      if (type == Segment.SYMBOL_DICTIONARY) {
        segmentsReferenced.add(seg);
        noOfSymbols += ((SymbolDictionarySegment) seg).getNoOfExportedSymbols();
      } else if (type == Segment.TABLES) {
        codeTables.add(seg);
      }
    }

    int symbolCodeLength = 0;
    int count = 1;

    while (count < noOfSymbols) {
      symbolCodeLength++;
      count <<= 1;
    }

    int currentSymbol = 0;
    JBIG2Bitmap[] symbols = new JBIG2Bitmap[noOfSymbols];
    for (Iterator it = segmentsReferenced.iterator(); it.hasNext();) {
      Segment seg = (Segment) it.next();
      if (seg.getSegmentHeader().getSegmentType() == Segment.SYMBOL_DICTIONARY) {
        JBIG2Bitmap[] bitmaps = ((SymbolDictionarySegment) seg).getBitmaps();
        for (int j = 0; j < bitmaps.length; j++) {
          symbols[currentSymbol] = bitmaps[j];
          currentSymbol++;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.