<commit_before>
/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */

package java.text;

class SimpleSentenceIterator extends BreakIterator {
	CharacterIterator iterator = new StringCharacterIterator("");

public int current() {
	return iterator.getIndex();
}

public int first() {
	iterator.first();
	return iterator.getIndex();
}

public int following(int offs) {
	iterator.setIndex(iterator.getBeginIndex() + offs);
	return next();		
}

public CharacterIterator getText() {
	return iterator;
}

public int last() {
	iterator.last();
	return previous();		
}

public int next() {

	if (iterator.current() == CharacterIterator.DONE)
		return DONE;

	for (char c = iterator.next();
	    c != CharacterIterator.DONE;
	    c = iterator.next()) {
		if (c == '.') {
			iterator.next();
			break;
		}
	}
	return iterator.getIndex();
}

public int next( int num) {
	int max = (num > 0) ? num : -num;

	for (int idx = 0; idx < max; idx++) {
		int c = (num > 0) ? next() : previous();
		if (c == CharacterIterator.DONE)
			return (DONE);
	}<commit_msg>Slight improvement to the end-of-sentence detection. Don't stop unless the period `.' is followed by a space.<commit_after>
/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */

package java.text;

class SimpleSentenceIterator extends BreakIterator {
	CharacterIterator iterator = new StringCharacterIterator("");

public int current() {
	return iterator.getIndex();
}

public int first() {
	iterator.first();
	return iterator.getIndex();
}

public int following(int offs) {
	iterator.setIndex(iterator.getBeginIndex() + offs);
	return next();		
}

public CharacterIterator getText() {
	return iterator;
}

public int last() {
	iterator.last();
	return previous();		
}

public int next() {

	if (iterator.current() == CharacterIterator.DONE)
		return DONE;

	for (char c = iterator.next(); c != CharacterIterator.DONE; ) {
		if (c == '.') {
			c = iterator.next();
			if (c != CharacterIterator.DONE && c != ' ')
				continue;
			break;
		}
	    	c = iterator.next();
	}
	return iterator.getIndex();
}

public int next( int num) {
	int max = (num > 0) ? num : -num;

	for (int idx = 0; idx < max; idx++) {
		int c = (num > 0) ? next() : previous();
		if (c == CharacterIterator.DONE)
			return (DONE);
	}
{'fraction_non_alphanumeric': 0.14164742109314857, 'fraction_numerical': 0.008468052347959968, 'mean_word_length': 3.5676625659050965, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7483698', 'n_tokens_mistral': 883, 'n_tokens_neox': 815, 'n_words': 259}