Returns all sentences in a paragraph.
@param para The paragraph
@return
420328
List<Integer> getParaSents(Integer para) {
	List<Integer> sentList = new ArrayList<Integer>(this.paraSentIndex.get(para));
	Collections.sort(sentList);
	return sentList;
    }
613913
public static String getFullDescription(Parameter<?> param) {
    StringBuilder description = new StringBuilder(1000) //
        .append(param.getShortDescription()).append(FormatUtil.NEWLINE);
    param.describeValues(description);
    if(!FormatUtil.endsWith(description, FormatUtil.NEWLINE)) {
      description.append(FormatUtil.NEWLINE);
    }
    if(param.hasDefaultValue()) {
      description.append("Default: ").append(param.getDefaultValueAsString()).append(FormatUtil.NEWLINE);
    }
    List<? extends ParameterConstraint<?>> constraints = param.getConstraints();
    if(constraints != null && !constraints.isEmpty()) {
      description.append((constraints.size() == 1) ? "Constraint: " : "Constraints: ") //
          .append(constraints.get(0).getDescription(param.getOptionID().getName()));
      for(int i = 1; i < constraints.size(); i++) {
        description.append(", ").append(constraints.get(i).getDescription(param.getOptionID().getName()));
      }
      description.append(FormatUtil.NEWLINE);
    }
    return description.toString();
  }
41096
def get_paragraph(self):
        
        self.text = ''
        for x in range(randint(5, 12)):
            sentence = self._write_sentence()
            self.text = self.text + sentence
        return self.text
216801
@Nullable
  List<String> getAllTextParagraphs() {
    try {
      List<String> allParas = new ArrayList<>();
      if (xPCursor == null) {
        return null;
      }
      xPCursor.gotoStart(false);
      xPCursor.gotoStartOfParagraph(false);
      xPCursor.gotoEndOfParagraph(true);
      allParas.add(xPCursor.getString());
      while (xPCursor.gotoNextParagraph(false)) {
        xPCursor.gotoStartOfParagraph(false);
        xPCursor.gotoEndOfParagraph(true);
        allParas.add(xPCursor.getString());
      }
      return allParas;
    } catch (Throwable t) {
      MessageHandler.printException(t);     // all Exceptions thrown by UnoRuntime.queryInterface are caught
      return null;           // Return null as method failed
    }
  }
408801
private static void splitInSentences(HashSet<String> sentencesSet, String text) {
		
		if (inputType == inputTypes.PARAGRAPH) { // split in multiple sentences
			LinkedList<LinkedList<Word>> sentences = Splitting.tokenizeSentences(LVMorphologyReaderAndWriter.getAnalyzer(), text);
			for (LinkedList<Word> sentence : sentences) 
			{
				if(sentence != null)
				{
					String madeSentence = "";
					for(int w = 0; w < sentence.size(); w++)
					{
						madeSentence = madeSentence + " " + sentence.get(w);
					}
					madeSentence = madeSentence.trim();
					//pārbaudam, vai teikuma atšķiribas nav punkts teikuma beigas
					if(madeSentence.length() > 0 && madeSentence.lastIndexOf(".") >= 0) madeSentence = madeSentence.substring(0, madeSentence.length() - 1);
					sentencesSet.add(madeSentence.trim());
				}
			}
		} 
	}
419948
func Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string {
	return paragraphGenerator(paragrapOptions{paragraphCount, sentenceCount, wordCount, separator}, Sentence)
}
1021771
public String tokenizeToText() {

    final StringBuilder sb = new StringBuilder();
    if (isNoSeg) {
      String[] sentences = text.toArray(new String[text.size()]);
      final List<List<Token>> tokens = tokenizer.tokenize(sentences);
      for (final List<Token> tokSentence : tokens) {
        for (final Token tok : tokSentence) {
          String tokenValue = tok.getTokenValue();
          sb.append(tokenValue.trim()).append(DELIMITER);
        }
        sb.append(LINE_BREAK);
      }
    } else {
      final String[] sentences = segmenter.segmentSentence();
      final List<List<Token>> tokens = tokenizer.tokenize(sentences);
      for (final List<Token> tokSentence : tokens) {
        for (final Token token : tokSentence) {
          String tokenValue = token.getTokenValue();
          if (tokenValue.equals(RuleBasedSegmenter.PARAGRAPH)) {
            sb.append(DEFAULT_TOKEN_VALUE).append(LINE_BREAK);
          } else {
            sb.append(tokenValue.trim()).append(DELIMITER);
          }
        }
        sb.append(LINE_BREAK);
      }
    }
    return sb.toString().trim();
  }
1225500
public static String paragraphs(int paragraphCount, boolean supplemental) {
        List<String> paragraphList = new ArrayList<String>();
        for (int i = 0; i < paragraphCount; i++) {
            paragraphList.add(paragraph(3, supplemental, 3));
        }

        String joined = StringUtils.join(paragraphList, "\n\n");
        return joined;

    }
1062525
def same_sentence(c):
    
    return all(
        _to_span(c[i]).sentence is not None
        and _to_span(c[i]).sentence == _to_span(c[0]).sentence
        for i in range(len(c))
    )
70412
public ImmutableList<Class<?>> getClassObjects(final String param) {
    final ImmutableList.Builder<Class<?>> ret = ImmutableList.builder();
    for (final String className : getStringList(param)) {
      try {
        ret.add(getClassObjectForString(className));
      } catch (ClassNotFoundException e) {
        throw new ParameterConversionException(fullString(param), className, e, "class");
      }
    }
    return ret.build();
  }
90332
def to_paragraphs(str)
      lines = str.scan(/([^\n]+\n|[^\n]*$)/).map { |l| l[0].strip }

      paragraphs = [[]]
      lines.each do |line|
        if line.empty?
          paragraphs << []
        else
          paragraphs.last << line
        end
      end

      paragraphs.reject(&:empty?).map { |p| p.join(' ') }
    end
1291035
private List<String> sentenceSplit(String str) {
		BreakIterator iterator = BreakIterator.getSentenceInstance(Locale.US);
		iterator.setText(str);
		int start = iterator.first();
		List<String> sentences = new ArrayList<String>();
		for (int end = iterator.next();
			 end != BreakIterator.DONE;
			 start = end, end = iterator.next()) {
			sentences.add(str.substring(start, end).trim());
		}
		return sentences;
	}
254154
public INDArray loadSingleSentence(String sentence) {
        List<String> tokens = tokenizeSentence(sentence);
        if(format == Format.CNN1D || format == Format.RNN){
            int[] featuresShape = new int[] {1, wordVectorSize, Math.min(maxSentenceLength, tokens.size())};
            INDArray features = Nd4j.create(featuresShape, (format == Format.CNN1D ? 'c' : 'f'));
            INDArrayIndex[] indices = new INDArrayIndex[3];
            indices[0] = NDArrayIndex.point(0);
            for (int i = 0; i < featuresShape[2]; i++) {
                INDArray vector = getVector(tokens.get(i));
                indices[1] = NDArrayIndex.all();
                indices[2] = NDArrayIndex.point(i);
                features.put(indices, vector);
            }
            return features;
        } else {
            int[] featuresShape = new int[] {1, 1, 0, 0};
            if (sentencesAlongHeight) {
                featuresShape[2] = Math.min(maxSentenceLength, tokens.size());
                featuresShape[3] = wordVectorSize;
            } else {
                featuresShape[2] = wordVectorSize;
                featuresShape[3] = Math.min(maxSentenceLength, tokens.size());
            }

            INDArray features = Nd4j.create(featuresShape);
            int length = (sentencesAlongHeight ? featuresShape[2] : featuresShape[3]);
            INDArrayIndex[] indices = new INDArrayIndex[4];
            indices[0] = NDArrayIndex.point(0);
            indices[1] = NDArrayIndex.point(0);
            for (int i = 0; i < length; i++) {
                INDArray vector = getVector(tokens.get(i));

                if (sentencesAlongHeight) {
                    indices[2] = NDArrayIndex.point(i);
                    indices[3] = NDArrayIndex.all();
                } else {
                    indices[2] = NDArrayIndex.all();
                    indices[3] = NDArrayIndex.point(i);
                }

                features.put(indices, vector);
            }

            return features;
        }
    }
17324
public AnalyzedSentence getRawAnalyzedSentence(String sentence) throws IOException {
    List<String> tokens = language.getWordTokenizer().tokenize(sentence);
    Map<Integer, String> softHyphenTokens = replaceSoftHyphens(tokens);

    List<AnalyzedTokenReadings> aTokens = language.getTagger().tag(tokens);
    if (language.getChunker() != null) {
      language.getChunker().addChunkTags(aTokens);
    }
    int numTokens = aTokens.size();
    int posFix = 0; 
    for (int i = 1; i < numTokens; i++) {
      aTokens.get(i).setWhitespaceBefore(aTokens.get(i - 1).isWhitespace());
      aTokens.get(i).setStartPos(aTokens.get(i).getStartPos() + posFix);
      if (!softHyphenTokens.isEmpty() && softHyphenTokens.get(i) != null) {
        aTokens.get(i).addReading(language.getTagger().createToken(softHyphenTokens.get(i), null));
        posFix += softHyphenTokens.get(i).length() - aTokens.get(i).getToken().length();
      }
    }
        
    AnalyzedTokenReadings[] tokenArray = new AnalyzedTokenReadings[tokens.size() + 1];
    AnalyzedToken[] startTokenArray = new AnalyzedToken[1];
    int toArrayCount = 0;
    AnalyzedToken sentenceStartToken = new AnalyzedToken("", SENTENCE_START_TAGNAME, null);
    startTokenArray[0] = sentenceStartToken;
    tokenArray[toArrayCount++] = new AnalyzedTokenReadings(startTokenArray, 0);
    int startPos = 0;
    for (AnalyzedTokenReadings posTag : aTokens) {
      posTag.setStartPos(startPos);
      tokenArray[toArrayCount++] = posTag;
      startPos += posTag.getToken().length();
    }

    // add additional tags
    int lastToken = toArrayCount - 1;
    // make SENT_END appear at last not whitespace token
    for (int i = 0; i < toArrayCount - 1; i++) {
      if (!tokenArray[lastToken - i].isWhitespace()) {
        lastToken -= i;
        break;
      }
    }

    tokenArray[lastToken].setSentEnd();

    if (tokenArray.length == lastToken + 1 && tokenArray[lastToken].isLinebreak()) {
      tokenArray[lastToken].setParagraphEnd();
    }
    return new AnalyzedSentence(tokenArray);
  }
52858
private List<Map.Entry<Sentence, Map.Entry<Integer, Integer>>> getRelevantSentences(List<String> inputs, String token, int maxSentences) throws IOException {
    List<Map.Entry<Sentence, Map.Entry<Integer, Integer>>> sentences = new ArrayList<>();
    for (String input : inputs) {
      if (new File(input).isDirectory()) {
        File file = new File(input, token + ".txt");
        if (!file.exists()) {
          throw new RuntimeException("File with example sentences not found: " + file);
        }
        try (FileInputStream fis = new FileInputStream(file)) {
          SentenceSource sentenceSource = new PlainTextSentenceSource(fis, language);
          sentences = getSentencesFromSource(inputs, token, maxSentences, sentenceSource);
        }
      } else {
        SentenceSource sentenceSource = MixingSentenceSource.create(inputs, language);
        sentences = getSentencesFromSource(inputs, token, maxSentences, sentenceSource);
      }
    }
    return sentences;
  }
285176
@Override
  public List<List<Token>> tokenize(final String[] sentences) {
    final long start = System.nanoTime();
    int noTokens = 0;
    int prevIndex = 0;
    int curIndex = 0;
    final String language = this.lang;
    final List<List<Token>> result = new ArrayList<List<Token>>();
    // TODO improve this
    final String offsetText = this.originalText;
    for (final String sentence : sentences) {
      if (DEBUG) {
        System.err.println("-> Segmented:" + sentence);
      }
      final List<Token> tokens = new ArrayList<Token>();
      final String[] curTokens = getTokens(sentence);
      for (final String arrayToken : curTokens) {
        curIndex = offsetText.indexOf(arrayToken, prevIndex);
        // crap rule for corrected URLs
        if (curIndex == -1) {
          curIndex = prevIndex + 1;
        }
        final Token curToken = this.tokenFactory.createToken(arrayToken,
            curIndex, arrayToken.length());
        // exceptions to WFs
        addTokens(curToken, tokens);
        if (DEBUG) {
          System.err.println("-> Token:" + arrayToken + " curIndex: " + curIndex
              + " prev: " + prevIndex);
        }
        prevIndex = curIndex + curToken.tokenLength();
      }
      result.add(tokens);
      noTokens = noTokens + curTokens.length;
    }
    normalizeTokens(result, language);
    final long duration = System.nanoTime() - start;
    final double toksPerSecond = noTokens / (duration / 1000000000.0);
    if (DEBUG) {
      System.err.printf(
          "ixa-pipe-tok tokenized %d tokens at %.2f tokens per second.%n",
          noTokens, toksPerSecond);
    }
    return result;
  }
899173
private function getParagraphArr($sentences)
    {
        $wordsPer = $this->wordsPerParagraph;
        $sentenceAvg = $this->wordsPerSentence;
        $total = count($sentences);

        $paragraphs = [];
//        $pCount = 0;
        $currCount = 0;
        $curr = [];

        for ($i = 0; $i < $total; ++$i) {
            $s = $sentences[$i];
            $currCount += count($s);
            $curr[] = $s;
            if ($currCount >= ($wordsPer - round($sentenceAvg / 2.00)) || $i === $total - 1) {
                $currCount = 0;
                $paragraphs[] = $curr;
                $curr = [];
                //print_r($paragraphs);
            }
            //print_r($paragraphs);
        }

        return $paragraphs;
    }