Examples of TextIterator


Examples of net.sourceforge.segment.TextIterator

      System.out.println("Segmenting... ");
    }

    long start = System.currentTimeMillis();

    TextIterator textIterator = createTextIterator(commandLine,
        document, reader, profile);

    performSegment(commandLine, textIterator, writer, profile);
   
    if (profile) {
View Full Code Here

Examples of net.sourceforge.segment.TextIterator

  }
 
  private TextIterator createTextIterator(CommandLine commandLine,
      SrxDocument document, Reader reader, boolean profile) {
   
    TextIterator textIterator;
   
    String languageCode = commandLine.getOptionValue('l');
    if (languageCode == null) {
      languageCode = "";
    }
View Full Code Here

Examples of net.sourceforge.segment.TextIterator

    }
  }

  static List<String> tokenize(String text, SrxDocument srxDocument, String code) {
    List<String> segments = new ArrayList<>();
    TextIterator textIterator = new SrxTextIterator(srxDocument, code, text);
    while (textIterator.hasNext()) {
      segments.add(textIterator.next());
    }
    return segments;
  }
View Full Code Here

Examples of org.apache.stanbol.entityhub.core.utils.TextIterator

        return getValuesAsCollection(field).iterator();
    }
    @Override
    public Iterator<Text> getText(String field) {
        Collection<Object> values = getValuesAsCollection(field);
        return values != null?new TextIterator(valueFactory,values.iterator()):null;
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.core.utils.TextIterator

    }

    @Override
    public Iterator<Text> get(String field, String... languages) {
        final Collection<Object> values = getValuesAsCollection(field);
        return new TextIterator(valueFactory,values.iterator(), languages);
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.core.utils.TextIterator

        if(values == null) {
            return;
        }
        if(values instanceof Collection<?>){
            int removed = 0;
            for(Iterator<Text> it = new TextIterator(valueFactory,
                    ((Collection<Object>)values).iterator(),
                    languages);it.hasNext();){
                it.next();//go to the next Element
                it.remove(); //and remove ist
                removed++;
            }
            if(removed>0){ //if some elements where removed
                //check if there is only a singe or no elements left for the field
                int size = ((Collection<Object>)values).size();
View Full Code Here

Examples of org.apache.stanbol.entityhub.core.utils.TextIterator

        if(values == null) {
            return;
        }
        if(values instanceof Collection<?>){
            int removed = 0;
            for(Iterator<Text> it = new TextIterator(valueFactory,
                    ((Collection<Object>)values).iterator(),
                    languages);it.hasNext();){
                Text label = it.next();//go to the next element
                if(text.equals(label.getText())){
                    it.remove();//and remove it
                    removed++;
                }
            }
            if(removed>0){ //if some elements where removed
                //check if there is only a singe or no elements left for the field
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.util.TextIterator

        return getValuesAsCollection(field).iterator();
    }
    @Override
    public Iterator<Text> getText(String field) {
        Collection<Object> values = getValuesAsCollection(field);
        return values != null?new TextIterator(valueFactory,values.iterator()):null;
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.util.TextIterator

    }

    @Override
    public Iterator<Text> get(String field, String... languages) {
        final Collection<Object> values = getValuesAsCollection(field);
        return new TextIterator(valueFactory,values.iterator(), languages);
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.util.TextIterator

        if(values == null) {
            return;
        }
        if(values instanceof Collection<?>){
            int removed = 0;
            for(Iterator<Text> it = new TextIterator(valueFactory,
                    ((Collection<Object>)values).iterator(),
                    languages);it.hasNext();){
                it.next();//go to the next Element
                it.remove(); //and remove ist
                removed++;
            }
            if(removed>0){ //if some elements where removed
                //check if there is only a singe or no elements left for the field
                int size = ((Collection<Object>)values).size();
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.