Examples of addSentence()


Examples of com.diagrammr.data.DiagramData.addSentence()

    if ("add".equals(command)) {
      if (sentence.length() > MAX_SENTENCE_LENGTH ||
          data.getSentences().size() > MAX_DIAGRAM_LENGTH) {
        return;
      }
      data.addSentence(sentence);
    } else if ("delete".equals(command)) {
      data.deleteSentence(sentence);
    } else if ("moveup".equals(command)) {
      data.moveUp(sentence);
    } else if ("movedown".equals(command)) {
View Full Code Here

Examples of common.RougeSummaryModel.addSentence()

      {
    summaryModel.setTitle(sent);
      }
      else
      {
    summaryModel.addSentence(sent);
      }
      id++;
  }

  return summaryModel;
View Full Code Here

Examples of kpi.asoiu.model.Text.addSentence()

        String[] sentences = sentenceDetector.sentDetect(inputText);
        ParseSentence parseSentence = ModelFactory.getInstance().getParseSentence();
        Text text = new Text();
        for (String sentence : sentences) {
            sentence = sentence.replaceAll(",","");
            text.addSentence(parseSentence.parse(sentence));
        }
        text.postProcess();
        return text.getSentences();
    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

            //first the sentences
            TokenStream sentences = new SentenceTokenizer(new CharSequenceReader(at.getText()));
            try {
                while(sentences.incrementToken()){
                    OffsetAttribute offset = sentences.addAttribute(OffsetAttribute.class);
                    Sentence s = at.addSentence(offset.startOffset(), offset.endOffset());
                    if(log.isTraceEnabled()) {
                        log.trace("detected {}:{}",s,s.getSpan());
                    }
                }
            } catch (IOException e) {
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

        TokenStream sentences = new SentenceTokenizer(new CharSequenceReader(at.getText()));
        try {
          sentences.reset();
            while(sentences.incrementToken()){
                OffsetAttribute offset = sentences.addAttribute(OffsetAttribute.class);
                Sentence s = at.addSentence(offset.startOffset(), offset.endOffset());
                if(log.isTraceEnabled()) {
                    log.trace("detected {}:{}",s,s.getSpan());
                }
            }
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

        String language = getLanguage(this, ci, true);
        SentenceDetector sentenceDetector = getSentenceDetector(language);
        if(sentenceDetector != null){
            for(opennlp.tools.util.Span sentSpan : sentenceDetector.sentPosDetect(at.getSpan())) {
                //detect sentences and add it to the AnalyzedText.
                Sentence sentence = at.addSentence(sentSpan.getStart(), sentSpan.getEnd());
                log.trace(" > add {}",sentence);
            }
        } else {
            log.warn("SentenceDetector model for language {} is no longer available. "
                + "This might happen if the model becomes unavailable during enhancement. "
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

                //Sentence detection by POS tag
                if(sentStartOffset < 0){ //the last token was a sentence ending
                  sentStartOffset = offset.startOffset();
                }
                if(posTag.hasPos(Pos.Point)) {
                    Sentence sent = at.addSentence(sentStartOffset, offset.startOffset());
                    //add the sentence as context to the NerData instances
                    while(nerSentIndex < nerList.size()){
                        nerList.get(nerSentIndex).context = sent.getSpan();
                        nerSentIndex++;
                    }
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

                }
            }
            //we still need to write the last sentence
            Sentence lastSent = null;
            if(offset != null && sentStartOffset >= 0 && offset.endOffset() > sentStartOffset){
                lastSent = at.addSentence(sentStartOffset, offset.endOffset());
            }
            //and set the context off remaining named entities
            while(nerSentIndex < nerList.size()){
                if(lastSent != null){
                    nerList.get(nerSentIndex).context = lastSent.getSpan();
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

        //first the sentences
        TokenStream sentences = new SentenceTokenizer(new CharSequenceReader(at.getText()));
        try {
            while(sentences.incrementToken()){
                OffsetAttribute offset = sentences.addAttribute(OffsetAttribute.class);
                Sentence s = at.addSentence(offset.startOffset(), offset.endOffset());
                if(log.isTraceEnabled()) {
                    log.trace("detected {}:{}",s,s.getSpan());
                }
            }
        } catch (IOException e) {
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.AnalysedText.addSentence()

        String language = getLanguage(this, ci, true);
        SentenceDetector sentenceDetector = getSentenceDetector(language);
        if(sentenceDetector != null){
            for(opennlp.tools.util.Span sentSpan : sentenceDetector.sentPosDetect(at.getSpan())) {
                //detect sentences and add it to the AnalyzedText.
                Sentence sentence = at.addSentence(sentSpan.getStart(), sentSpan.getEnd());
                log.trace(" > add {}",sentence);
            }
        } else {
            log.warn("SentenceDetector model for language {} is no longer available. "
                + "This might happen if the model becomes unavailable during enhancement. "
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.