<commit_before>/* Copyright 2002-2021 CS GROUP
 * Licensed to CS GROUP (CS) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * CS 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 org.orekit.files.ccsds.ndm.tdm;

import org.orekit.files.ccsds.definitions.Units;
import org.orekit.files.ccsds.utils.ContextBinding;
import org.orekit.files.ccsds.utils.lexical.ParseToken;
import org.orekit.files.ccsds.utils.lexical.TokenType;
import org.orekit.utils.units.Unit;


/** Keys for {@link TdmMetadata TDM container} entries.
 * @author <NAME>
 * @since 11.0
 */
public enum TdmMetadataKey {

    /** Start time entry. */
    START_TIME((token, context, container) -> token.processAsDate(container::setStartTime, context)),

    /** Stop time entry. */
    STOP_TIME((token, context, container) -> token.processAsDate(container::setStopTime, context)),

    /** First participant entry. */
    PARTICIPANT_1((token, context, container) -> token.processAsIndexedNormalizedString(1, container::addParticipant)),

    /** Second participant entry. */
    PARTICIPANT_2((token, context, container) -> token.processAsIndexedNormalizedString(2, container::addParticipant)),

    /** Third participant entry. */
    PARTICIPANT_3((token, context, container) -> token.processAsIndexedNormalizedString(3, container::addParticipant)),

    /** Fourth participant entry. */
    PARTICIPANT_4((token, context, container) -> token.processAsIndexedNormalizedString(4, container::addParticipant)),

    /** Fifth participant entry. */
    PARTICIPANT_5((token, context, container) -> token.processAsIndexedNormalizedString(5, container::addParticipant)),

    /** Mode entry. */
    MODE((token, context, container) -> {
        if (token.getType() == TokenType.ENTRY) {
            try {
                container.setMode(TrackingMode.valueOf(token.getContentAsUppercaseString()));
                return true;
            } catch (IllegalArgumentException iae) {
                throw token.generateException(iae);
            }
        }
        return true;
    }),

    /** Path entry. */
    PATH((token, context, container) -> token.processAsIntegerArray(container::setPath)),

    /** Path 1 entry. */
    PATH_1((token, context, container) -> token.processAsIntegerArray(container::setPath1)),

    /** Path 2 entry. */
    PATH_2((token, context, container) -> token.processAsIntegerArray(container::setPath2)),

    /** Transmit band entry. */
    TRANSMIT_BAND((token, context, container) -> token.processAsUppercaseString(container::setTransmitBand)),
<commit_msg>Fixed a parse error for SINGLE_DIFF mode.<commit_after>/* Copyright 2002-2021 CS GROUP
 * Licensed to CS GROUP (CS) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * CS 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 org.orekit.files.ccsds.ndm.tdm;

import org.orekit.files.ccsds.definitions.Units;
import org.orekit.files.ccsds.utils.ContextBinding;
import org.orekit.files.ccsds.utils.lexical.ParseToken;
import org.orekit.files.ccsds.utils.lexical.TokenType;
import org.orekit.utils.units.Unit;


/** Keys for {@link TdmMetadata TDM container} entries.
 * @author <NAME>
 * @since 11.0
 */
public enum TdmMetadataKey {

    /** Start time entry. */
    START_TIME((token, context, container) -> token.processAsDate(container::setStartTime, context)),

    /** Stop time entry. */
    STOP_TIME((token, context, container) -> token.processAsDate(container::setStopTime, context)),

    /** First participant entry. */
    PARTICIPANT_1((token, context, container) -> token.processAsIndexedNormalizedString(1, container::addParticipant)),

    /** Second participant entry. */
    PARTICIPANT_2((token, context, container) -> token.processAsIndexedNormalizedString(2, container::addParticipant)),

    /** Third participant entry. */
    PARTICIPANT_3((token, context, container) -> token.processAsIndexedNormalizedString(3, container::addParticipant)),

    /** Fourth participant entry. */
    PARTICIPANT_4((token, context, container) -> token.processAsIndexedNormalizedString(4, container::addParticipant)),

    /** Fifth participant entry. */
    PARTICIPANT_5((token, context, container) -> token.processAsIndexedNormalizedString(5, container::addParticipant)),

    /** Mode entry. */
    MODE((token, context, container) -> {
        if (token.getType() == TokenType.ENTRY) {
            try {
                container.setMode(TrackingMode.valueOf(token.getContentAsUppercaseString().replace(' ', '_')));
                return true;
            } catch (IllegalArgumentException iae) {
                throw token.generateException(iae);
            }
        }
        return true;
    }),

    /** Path entry. */
    PATH((token, context, container) -> token.processAsIntegerArray(container::setPath)),

    /** Path 1 entry. */
    PATH_1((token, context, container) -> token.processAsIntegerArray(container::setPath1)),

    /** Path 2 entry. */
    PATH_2((token, context, container) -> token.processAsIntegerArray(container::setPath2)),

    /** Transmit band entry. */
    TRANSMIT_BAND((token, context, container) -> token.processAsUppercaseString(container::setTransmitBand)),

{'fraction_non_alphanumeric': 0.11933581626319056, 'fraction_numerical': 0.009621353196772191, 'mean_word_length': 3.7776130467012603, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '15399', 'n_tokens_mistral': 1824, 'n_tokens_neox': 1747, 'n_words': 490}