src/main/java/lv/semti/morphology/analyzer/Splitting.java
public static LinkedList<LinkedList<Word>> tokenizeSentences(
		 	Analyzer morphoAnalyzer, String paragraph, int lengthCap) {
		LinkedList<LinkedList<Word>> result = new LinkedList<LinkedList<Word>>();
		
		List<Word> tokens = Splitting.tokenize(morphoAnalyzer, paragraph);
		LinkedList<Word> sentence = new LinkedList<Word>();
		for (Word word : tokens) {
		    // Teikumu beigas iekšā tiešajā runā - pievelkam pēdiņu klāt
            if (sentence.size() == 0) {
                if ((word.isRecognized() && word.getBestWordform().getTag().equalsIgnoreCase("zq")) || word.getToken().equals(")")) {
                    // Pārbaudam vai iepriekšējā teikuma beigās ir punkts
                    if (!result.isEmpty() && !result.getLast().isEmpty()) {
                        String prevtoken = result.getLast().getLast().getToken();
                        if (prevtoken.equals(".") || prevtoken.equals("!") || prevtoken.equals("?") || prevtoken.equals("\"")) {
                            result.getLast().add(word);
                            continue;
                        }
                    }
                }
            }

			sentence.add(word);
			if ( Splitting.isChunkCloser(word) || // does this token look like end of sentence
				(sentence.size() >= lengthCap-5 && (word.hasAttribute(AttributeNames.i_PartOfSpeech, AttributeNames.v_Punctuation) || word.getToken().startsWith("<")) )
				|| sentence.size() > lengthCap) { 		// hard limit		
				result.add(sentence);
				sentence = new LinkedList<Word>();
			}
		}
		
		if (!sentence.isEmpty()) 
			result.add(sentence);
		return result;
	}
public static LinkedList<LinkedList<Word>> tokenizeSentences(
		 	Analyzer morphoAnalyzer, String paragraph, int lengthCap) {
		LinkedList<LinkedList<Word>> result = new LinkedList<LinkedList<Word>>();
		
		List<Word> tokens = Splitting.tokenize(morphoAnalyzer, paragraph);
		LinkedList<Word> sentence = new LinkedList<Word>();
		for (Word word : tokens) {
		    // Teikumu beigas iekšā tiešajā runā - pievelkam pēdiņu klāt
            if (sentence.size() == 0) {
                if ((word.isRecognized() && word.getBestWordform().getTag().equalsIgnoreCase("zq")) || word.getToken().equals(")")) {
                    // Pārbaudam vai iepriekšējā teikuma beigās ir punkts
                    if (!result.isEmpty() && !result.getLast().isEmpty()) {
                        String prevtoken = result.getLast().getLast().getToken();
                        if (prevtoken.equals(".") || prevtoken.equals("!") || prevtoken.equals("?") || prevtoken.equals("\"")) {
                            result.getLast().add(word);
                            continue;
                        }
                    }
                }
            }

			sentence.add(word);
			if ( Splitting.isChunkCloser(word) || // does this token look like end of sentence
				(sentence.size() >= lengthCap-5 && (word.hasAttribute(AttributeNames.i_PartOfSpeech, AttributeNames.v_Punctuation) || word.getToken().startsWith("<")) )
				|| sentence.size() > lengthCap) { 		// hard limit		
				result.add(sentence);
				sentence = new LinkedList<Word>();
			}
		}
		
		if (!sentence.isEmpty()) 
			result.add(sentence);
		return result;
	}
public static LinkedList < LinkedList < Word > > tokenizeSentences ( Analyzer morphoAnalyzer , String paragraph , int lengthCap ) { LinkedList < LinkedList < Word >> result = new LinkedList < LinkedList < Word > > ( ) ; List < Word > tokens = Splitting . tokenize ( morphoAnalyzer , paragraph ) ; LinkedList < Word > sentence = new LinkedList < Word > ( ) ; for ( Word word : tokens ) { // Teikumu beigas iekšā tiešajā runā - pievelkam pēdiņu klāt
 if ( sentence . size ( ) == 0 ) { if ( ( word . isRecognized ( ) && word . getBestWordform ( ) . getTag ( ) . equalsIgnoreCase ( "zq" ) ) || word . getToken ( ) . equals ( ")" ) ) { // Pārbaudam vai iepriekšējā teikuma beigās ir punkts
 if ( ! result . isEmpty ( ) && ! result . getLast ( ) . isEmpty ( ) ) { String prevtoken = result . getLast ( ) . getLast ( ) . getToken ( ) ; if ( prevtoken . equals ( "." ) || prevtoken . equals ( "!" ) || prevtoken . equals ( "?" ) || prevtoken . equals ( "\"" ) ) { result . getLast ( ) . add ( word ) ; continue ; } } } } sentence . add ( word ) ; if ( Splitting . isChunkCloser ( word ) || // does this token look like end of sentence
 ( sentence . size ( ) >= lengthCap - 5 && ( word . hasAttribute ( AttributeNames . i_PartOfSpeech , AttributeNames . v_Punctuation ) || word . getToken ( ) . startsWith ( "<" ) ) ) || sentence . size ( ) > lengthCap ) { // hard limit		
 result . add ( sentence ) ; sentence = new LinkedList < Word > ( ) ; } } if ( ! sentence . isEmpty ( ) ) result . add ( sentence ) ; return result ; }
*
Tokenizes a paragraph, and splits it into sentences.
@param morphoAnalyzer
@param paragraph
@return
* Tokenizes a paragraph and splits it into sentences .