Examples of segment()


Examples of WordSegment.WordSegment.segment()

  @Override
  public char[] parseLanguage(String document) {
    StringBuilder stringBuilder = new StringBuilder(document.length());
    WordSegment wordSegmenter = new WordSegment(new FMM());
    List<String> segmented = wordSegmenter.segment(document);
    for (String word : segmented) {
      stringBuilder.append(word).append(" ");
    }
    return stringBuilder.toString().toCharArray();
  }
View Full Code Here

Examples of edu.stanford.nlp.process.WordSegmenter.segment()

          for (Iterator<HasWord> wordIter = goldSentence.iterator(); wordIter.hasNext();) {
            StringLabel word = (StringLabel) wordIter.next();
            goldCharBuf.append(word.value());
          }
          String goldChars = goldCharBuf.toString();
          s = seg.segment(goldChars);
        } else {
          s = goldSentence;
        }
        Tree tree;
        if (parse) {
View Full Code Here

Examples of etc.aloe.processes.Segmentation.segment()

            saveCommand(options.outputCommandFile);
           
            //Get and preprocess the data
            MessageSet messages = this.loadMessages(options.inputCSVFile);
            Segmentation segmentation = factory.constructSegmentation();
            SegmentSet segments = segmentation.segment(messages);

            //Set up a cross validation controller.
            CrossValidationController crossValidationController = new CrossValidationController();
            //Configure controller
            factory.configureCrossValidation(crossValidationController);
View Full Code Here

Examples of javax.ws.rs.core.UriBuilder.segment()

public class UriBuilderImplTest extends TestCase {

    public void testUriBuilderSimple() {
        UriBuilder builder = new UriBuilderImpl();
        builder.scheme("http").host("localhost").port(8080);
        builder.segment("some", "path");
        builder.segment("matrix1");
        builder.matrixParam("a", "1");
        builder.matrixParam("b", "2");
        builder.segment("matrix2");
        builder.matrixParam("c", "3");
View Full Code Here

Examples of org.apache.qpid.transport.codec.BBEncoder.segment()

        }
        else if (message instanceof BytesMessage)
        {
            BBEncoder encoder = new BBEncoder(1024);
            encoder.writeList(list);
            ByteBuffer buf = encoder.segment();
            byte[] data = new byte[buf.limit()];
            buf.get(data);
            ((BytesMessage)message).writeBytes(data);
        }
        else
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.segment()

            String referencePath = null;
            reference = reference.toLowerCase();
            if (reference.startsWith("::")) {
                String tmpPath = "/";
                for (int i = 0; i < relativePathToMediumFolder.segmentCount(); i++) {
                    tmpPath += relativePathToMediumFolder.segment(i) + "/";
                }

                referencePath = reference.replace("::", tmpPath);
                referencePath = referencePath.replaceAll(":", "/");
                //referencePath += "." + scriptType;
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.segment()

      String referencePath = null;
      reference = reference.toLowerCase();
      if (reference.startsWith("::")) {
        String tmpPath = scriptType + "/";
        for (int i = 0; i < relativePathToMediumFolder.segmentCount(); i++) {
          tmpPath += relativePathToMediumFolder.segment(i) + "/";
        }

        referencePath = reference.replace("::", tmpPath);
        referencePath = referencePath.replaceAll(":", "/");
        referencePath += "." + scriptType;
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.segment()

                    if (segmentCount > 0) {
                        // create folder and its parents
                        IContainer container = project;
                        for (int j = 0; j < segmentCount; j++) {
                            IFolder folder = container.getFolder(new Path(
                                sourcePath.segment(j)));
                            if (!folder.exists()) {
                                folder.create(true, true, null);
                            }
                            container = folder;
                        }
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.segment()

              if (variableName.equals(entry.getPath().segment(0))){
                affectedProjectClasspaths.put(project, project.getResolvedClasspath());
                continue nextProject;
              }
              IPath sourcePath, sourceRootPath;
              if (((sourcePath = entry.getSourceAttachmentPath()) != null  && variableName.equals(sourcePath.segment(0)))
                || ((sourceRootPath = entry.getSourceAttachmentRootPath()) != null  && variableName.equals(sourceRootPath.segment(0)))) {
 
                affectedProjectClasspaths.put(project, project.getResolvedClasspath());
                continue nextProject;
              }
View Full Code Here

Examples of org.eclipse.core.runtime.IPath.segment()

      if (entry == null) continue;
      IPath entryPath = entry.getPath();
      int kind = entry.getEntryKind();

      // Build some common strings for status message
      boolean isProjectRelative = projectName.equals(entryPath.segment(0));
      String entryPathMsg = isProjectRelative ? entryPath.removeFirstSegments(1).toString() : entryPath.makeRelative().toString();

      // complain if duplicate path
      if (!pathes.add(entryPath)){
        return new JavaModelStatus(IJavaModelStatusConstants.NAME_COLLISION, Messages.bind(Messages.classpath_duplicateEntryPath, new String[] {entryPathMsg, projectName}));
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.