<commit_before>/*
 *  Licensed to GraphHopper GmbH under one or more contributor
 *  license agreements. See the NOTICE file distributed with this work for 
 *  additional information regarding copyright ownership.
 * 
 *  GraphHopper GmbH licenses this file to you under the Apache License, 
 *  Version 2.0 (the "License"); you may not use this file except in 
 *  compliance with the License. You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.graphhopper.reader.osm.conditional;

import com.graphhopper.reader.ConditionalTagInspector;
import com.graphhopper.reader.ReaderWay;
import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Inspects the conditional tags of an OSMWay according to the given conditional tags.
 * <p>
 * @author <NAME>
 */
public class ConditionalOSMTagInspector implements ConditionalTagInspector
{
    private final Logger logger = LoggerFactory.getLogger(getClass());
    // enabling by default makes noise but could improve OSM data
    private boolean enabledLogs = true;
    private final List<String> tagsToCheck;
    private final Map<String, Object> valueMap;
    private final ConditionalParser permitParser, restrictiveParser;

    public ConditionalOSMTagInspector( Object value, List<String> tagsToCheck,
                                     Set<String> restrictiveValues, Set<String> permittedValues )
    {
        this(tagsToCheck, createDefaultMapping(value), restrictiveValues, permittedValues, true);
    }

    public ConditionalOSMTagInspector( List<String> tagsToCheck, Map<String, Object> valueMap,
                                     Set<String> restrictiveValues, Set<String> permittedValues, boolean enabledLogs )
    {
        this.valueMap = valueMap;
        this.tagsToCheck = new ArrayList<>(tagsToCheck.size());
        for (String tagToCheck : tagsToCheck)
        {
            this.tagsToCheck.add(tagToCheck + ":conditional");
        }<commit_msg>do not log conditional tag limitations anymore<commit_after>/*
 *  Licensed to GraphHopper GmbH under one or more contributor
 *  license agreements. See the NOTICE file distributed with this work for 
 *  additional information regarding copyright ownership.
 * 
 *  GraphHopper GmbH licenses this file to you under the Apache License, 
 *  Version 2.0 (the "License"); you may not use this file except in 
 *  compliance with the License. You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.graphhopper.reader.osm.conditional;

import com.graphhopper.reader.ConditionalTagInspector;
import com.graphhopper.reader.ReaderWay;
import java.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Inspects the conditional tags of an OSMWay according to the given conditional tags.
 * <p>
 * @author <NAME>
 */
public class ConditionalOSMTagInspector implements ConditionalTagInspector
{
    private final Logger logger = LoggerFactory.getLogger(getClass());
    // enabling by default makes noise but could improve OSM data
    private boolean enabledLogs = true;
    private final List<String> tagsToCheck;
    private final Map<String, Object> valueMap;
    private final ConditionalParser permitParser, restrictiveParser;

    public ConditionalOSMTagInspector( Object value, List<String> tagsToCheck,
                                       Set<String> restrictiveValues, Set<String> permittedValues )
    {
        this(tagsToCheck, createDefaultMapping(value), restrictiveValues, permittedValues, false);
    }

    public ConditionalOSMTagInspector( List<String> tagsToCheck, Map<String, Object> valueMap,
                                       Set<String> restrictiveValues, Set<String> permittedValues, boolean enabledLogs )
    {
        this.valueMap = valueMap;
        this.tagsToCheck = new ArrayList<>(tagsToCheck.size());
        for (String tagToCheck : tagsToCheck)
        {
            this.tagsToCheck.add(tagToCheck + ":conditional");
        }
{'fraction_non_alphanumeric': 0.07276595744680851, 'fraction_numerical': 0.002553191489361702, 'mean_word_length': 3.489971346704871, 'pattern_counts': {'":': 2, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2281651', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1185, 'n_words': 436}