<commit_before>/* Copyright (C) 2002 Univ. of Massachusetts Amherst, Computer Science Dept.
   This file is part of "MALLET" (MAchine Learning for LanguagE Toolkit).
   http://www.cs.umass.edu/~mccallum/mallet
   This software is provided under the terms of the Common Public License,
   version 1.0, as published by http://www.opensource.org.  For further
   information, see the file `LICENSE' included with this distribution. */




/** 
		Count the number of times the provided regular expression matches
		the token text, and add a feature with the provided name having
		value equal to the count.

		@author <NAME> <a href="mailto:<EMAIL>"><EMAIL></a>
 */

package cc.mallet.pipe.tsf;

import java.util.regex.Pattern;
import java.util.regex.Matcher;

import cc.mallet.pipe.*;
import cc.mallet.types.*;

/**
 * Produces feature with the count (if non-zero) that the given regex is found in an instance' token.
 * 
 * The user can specify the count type, namely:
 * <ul>
 * <li>{@link #INTEGER_COUNT} currently no effect</li>
 * <li>{@link #BINARY_COUNT} found (1) or nothing</li>
 * <li>{@link #NORMALIZED_COUNT} if found, count / token.length()</li>
 * </ul>
 * 
 * If the feature is activated, regex found at least one, the count is written as double.
 * 
 */<commit_msg>minor typo in doc correction<commit_after>/* Copyright (C) 2002 Univ. of Massachusetts Amherst, Computer Science Dept.
   This file is part of "MALLET" (MAchine Learning for LanguagE Toolkit).
   http://www.cs.umass.edu/~mccallum/mallet
   This software is provided under the terms of the Common Public License,
   version 1.0, as published by http://www.opensource.org.  For further
   information, see the file `LICENSE' included with this distribution. */




/** 
		Count the number of times the provided regular expression matches
		the token text, and add a feature with the provided name having
		value equal to the count.

		@author <NAME> <a href="mailto:<EMAIL>"><EMAIL></a>
 */

package cc.mallet.pipe.tsf;

import java.util.regex.Pattern;
import java.util.regex.Matcher;

import cc.mallet.pipe.*;
import cc.mallet.types.*;

/**
 * Produces feature with the count (if non-zero) that the given regex is found in an instance' token.
 * 
 * The user can specify the count type, namely:
 * <ul>
 * <li>{@link #INTEGER_COUNT} currently no effect</li>
 * <li>{@link #BINARY_COUNT} found (1) or nothing</li>
 * <li>{@link #NORMALIZED_COUNT} if found, count / token.length()</li>
 * </ul>
 * 
 * If the feature is activated, regex found at least once, the count is written as double.
 * 
 */
{'fraction_non_alphanumeric': 0.11586314152410575, 'fraction_numerical': 0.005443234836702955, 'mean_word_length': 3.756007393715342, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '6875316', 'n_tokens_mistral': 817, 'n_tokens_neox': 781, 'n_words': 310}