<commit_before>/*
 * Copyright 2014, Red Hat, Inc. and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.zanata.client.commands;

import org.apache.commons.io.FilenameUtils;
import org.zanata.common.ProjectType;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;

/**
 * Represents document name without extension.
 */
public class UnqualifiedSrcDocName {
    private final String name;
    UnqualifiedSrcDocName(String name) {
        this.name = name;
    }
    public static UnqualifiedSrcDocName from(String docName) {
        String extension = FilenameUtils.getExtension(docName);
        Preconditions.checkArgument(Strings.isNullOrEmpty(extension),
                "expect an unqualified document name (without extension)");
        return new UnqualifiedSrcDocName(docName);
    }
    public QualifiedSrcDocName toQualifiedDocName(ProjectType projectType) {
        switch (projectType) {
            case Utf8Properties:
            case Properties:
                return QualifiedSrcDocName
                        .from(name, "properties");<commit_msg>rhbz1157359 - remove extension check when dealing with unqualified source doc names<commit_after>/*
 * Copyright 2014, Red Hat, Inc. and individual contributors
 * as indicated by the @author tags. See the copyright.txt file in the
 * distribution for a full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */

package org.zanata.client.commands;

import org.zanata.common.ProjectType;

/**
 * Represents document name without extension.
 */
public class UnqualifiedSrcDocName {
    private final String name;
    UnqualifiedSrcDocName(String name) {
        this.name = name;
    }

    public static UnqualifiedSrcDocName from(String docName) {
        return new UnqualifiedSrcDocName(docName);
    }

    public QualifiedSrcDocName toQualifiedDocName(ProjectType projectType) {
        switch (projectType) {
            case Utf8Properties:
            case Properties:
                return QualifiedSrcDocName
                        .from(name, "properties");
{'fraction_non_alphanumeric': 0.06618435155412647, 'fraction_numerical': 0.01152197213290461, 'mean_word_length': 3.381455399061033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5016809', 'n_tokens_mistral': 970, 'n_tokens_neox': 916, 'n_words': 410}