<commit_before>package com.civilizer.domain;

import java.io.Serializable;
import java.util.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

import com.civilizer.utils.Pair;

@SuppressWarnings("serial")
public final class SearchParams implements Serializable {
	
	public static final int TARGET_DEFAULT       = 0;
	public static final int TARGET_TAG           = 1;
	public static final int TARGET_TITLE         = 2;
	public static final int TARGET_TEXT          = 3;
	public static final int TARGET_ID            = 4;
	
	private static final TargetDirective[] DIRECTIVES = {
	    new TargetDirective(":", TARGET_DEFAULT, false),    
	    new TargetDirective("any:", TARGET_DEFAULT, true),
        new TargetDirective("tag:", TARGET_TAG, false), 
        new TargetDirective("anytag:", TARGET_TAG, true),
        new TargetDirective("title:", TARGET_TITLE, false), 
        new TargetDirective("anytitle:", TARGET_TITLE, true),
        new TargetDirective("text:", TARGET_TEXT, false),   
        new TargetDirective("anytext:", TARGET_TEXT, true),
        new TargetDirective("id:", TARGET_ID, true),
    };
	
	private static final String TARGET_DIRECTIVE_PATTERN =
	        "(\\b(any|tag|tagh|anytag|title|anytitle|text|anytext|id)\\b)?:";
	
	private static final String CONTROL_OPERATORS = "cwberh-";
	
	public static final class Keyword implements Serializable {
		private final String word;
		private final boolean caseSensitive;
		private final boolean wholeWord;
		private final boolean beginningWith;
		private final boolean endingWith;
		private final boolean regex;
		private final boolean inverse;
		private final boolean id;
		private final boolean tagHeirarchy;
		
		public Keyword(String src, boolean isId) {
			String word = src.trim();
			boolean caseSensitive = false;<commit_msg>[update] keyword search; removed an irrelavent pattern when matching category operators;<commit_after>package com.civilizer.domain;

import java.io.Serializable;
import java.util.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;

import com.civilizer.utils.Pair;

@SuppressWarnings("serial")
public final class SearchParams implements Serializable {
	
	public static final int TARGET_DEFAULT       = 0;
	public static final int TARGET_TAG           = 1;
	public static final int TARGET_TITLE         = 2;
	public static final int TARGET_TEXT          = 3;
	public static final int TARGET_ID            = 4;
	
	private static final TargetDirective[] DIRECTIVES = {
	    new TargetDirective(":", TARGET_DEFAULT, false),    
	    new TargetDirective("any:", TARGET_DEFAULT, true),
        new TargetDirective("tag:", TARGET_TAG, false), 
        new TargetDirective("anytag:", TARGET_TAG, true),
        new TargetDirective("title:", TARGET_TITLE, false), 
        new TargetDirective("anytitle:", TARGET_TITLE, true),
        new TargetDirective("text:", TARGET_TEXT, false),   
        new TargetDirective("anytext:", TARGET_TEXT, true),
        new TargetDirective("id:", TARGET_ID, true),
    };
	
	private static final String TARGET_DIRECTIVE_PATTERN =
	        "(\\b(any|tag|anytag|title|anytitle|text|anytext|id)\\b)?:";
	
	private static final String CONTROL_OPERATORS = "cwberh-";
	
	public static final class Keyword implements Serializable {
		private final String word;
		private final boolean caseSensitive;
		private final boolean wholeWord;
		private final boolean beginningWith;
		private final boolean endingWith;
		private final boolean regex;
		private final boolean inverse;
		private final boolean id;
		private final boolean tagHeirarchy;
		
		public Keyword(String src, boolean isId) {
			String word = src.trim();
			boolean caseSensitive = false;
{'fraction_non_alphanumeric': 0.09108108108108108, 'fraction_numerical': 0.002702702702702703, 'mean_word_length': 3.876152832674572, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '974802', 'n_tokens_mistral': 1111, 'n_tokens_neox': 1023, 'n_words': 321}