<commit_before>package bsChecker;

import java.util.ArrayList;

/**
 * @author JeremiahDeGreeff
 * Finds verbs in progressive tense. (12)
 */
public class ErrorProgressiveTense extends Error {
	private static final int ERROR_NUMBER = 12;
	private static final String[] TO_BE_CONJ = {"be", "am", "is", "are", "was", "were", "been"};

	/**
	 * for testing purposes
	 */
	public static void main(String[] args) {
		Error.setupOpenNLP();
		String input = "Sensing God's desire to destroy Sodom, Abraham is negotiating for a less apocalyptic punishment";
		System.out.println("\ninput: " + input + "\n");
		ArrayList<int[]> errors = new ErrorProgressiveTense().findErrors(input);
		sort(errors);
		printErrors(tokensToChars(input, errors, 0), input);
	}

	/**
	 * finds all instances of progressive tense in the given paragraph
	 * known issues: does not catch cases with intermediary adverbs
	 * @param line paragraph to check
	 * @return ArrayList int[3] representing errors where [0] is the beginning token index, [1] is ending token index, [2] is the type of error (12)
	 */
	@Override
	public ArrayList<int[]> findErrors(String line) {
		String[] tokens = tokenizer.tokenize(line);
		String[] tags = posTagger.tag(tokens);
		
		ArrayList<int[]> errors = new ArrayList<int[]>();
		for(int i = 1; i < tokens.length; i++)
			if(tags[i].equals("VBG") && tokens[i].charAt(0) != '\"' &&arrayContains(TO_BE_CONJ, tokens[i - 1]))
					errors.add(new int[]{i - 1, i, ERROR_NUMBER});
		
		return errors;
	}
}
<commit_msg>Intermediate adjectives ignored by possessive tense fidner<commit_after>package bsChecker;

import java.util.ArrayList;

/**
 * @author JeremiahDeGreeff
 * Finds verbs in progressive tense. (12)
 */
public class ErrorProgressiveTense extends Error {
	private static final int ERROR_NUMBER = 12;
	private static final String[] TO_BE_CONJ = {"be", "am", "is", "are", "was", "were", "been"};

	/**
	 * for testing purposes
	 */
	public static void main(String[] args) {
		Error.setupOpenNLP();
		String input = "Sensing God's desire to destroy Sodom, Abraham is quickly negotiating for a less apocalyptic punishment";
		System.out.println("\ninput: " + input + "\n");
		ArrayList<int[]> errors = new ErrorProgressiveTense().findErrors(input);
		sort(errors);
		printErrors(tokensToChars(input, errors, 0), input);
	}

	/**
	 * finds all instances of progressive tense in the given paragraph
	 * known issues: does not catch cases with intermediary adverbs
	 * @param line paragraph to check
	 * @return ArrayList int[3] representing errors where [0] is the beginning token index, [1] is ending token index, [2] is the type of error (12)
	 */
	@Override
	public ArrayList<int[]> findErrors(String line) {
		String[] tokens = tokenizer.tokenize(line);
		String[] tags = posTagger.tag(tokens);
		
		ArrayList<int[]> errors = new ArrayList<int[]>();
		for(int i = 1; i < tokens.length; i++)
			if(arrayContains(TO_BE_CONJ, tokens[i])){
				int j = i+1;
				while(tags[j].equals("RB")) j++;
				if(tags[j].equals("VBG")){
					errors.add(new int[]{i, j, ERROR_NUMBER});
				}
			}
			/*if(tags[i].equals("VBG") && tokens[i].charAt(0) != '\"' &&arrayContains(TO_BE_CONJ, tokens[i - 1]))
					errors.add(new int[]{i - 1, i, ERROR_NUMBER});*/
		
		return errors;
	}
}

{'fraction_non_alphanumeric': 0.14718482252141982, 'fraction_numerical': 0.009485924112607099, 'mean_word_length': 4.33278955954323, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '5550952', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1022, 'n_words': 325}