class ListDiscoverer {

    public static boolean entriesUniform(List<String> entries, boolean tableDuplicateCheck) {

        int totalEntries = entries.size();
        int numericEntries = 0;
        int completelyCapitalized = 0;
        int totalWordLength = 0;
        // int missingEntries = 0;

        Set<String> duplicateCountSet = new HashSet<String>();
        Set<String> duplicateWordCountSet = new HashSet<String>();
        int duplicateCount = 0;
        int duplicateWordCount = 0;

        for (String entry : entries) {

            entry = StringHelper.trim(entry);

            totalWordLength += entry.split(" ").length;

            if (entry.length() > 200) {
                continue;
            }

            try {
                if (StringHelper.isNumericExpression(entry) || StringHelper.isTimeExpression(entry)) {
                    numericEntries++;
                }
            } catch (NumberFormatException e) {
                LOGGER.error(entry, e);
            } catch (OutOfMemoryError e) {
                LOGGER.error(entry, e);
            }

            if (StringHelper.isCompletelyUppercase(entry)) {
                completelyCapitalized++;
            }

            if (entry.length() == 0) {
                // missingEntries++;
            } else if (!duplicateCountSet.add(entry)) {
                duplicateCount++;
                if (duplicateWordCountSet.add(entry)) {
                    duplicateWordCount++;
                }
            }
        }

        if ((double)numericEntries / (double)totalEntries > 0.15) {
            LOGGER.info("entries not uniform because too many numeric entries");
            return false;
        }
        if ((double)completelyCapitalized / (double)totalEntries > 0.5) {
            LOGGER.info("entries not uniform because too many entirely capitalized entries");
            return false;
        }
        if ((double)totalWordLength / (double)totalEntries > 12) {
            LOGGER.info("entries not uniform because average word length too long");
            return false;
        }
        if (tableDuplicateCheck && (double)duplicateCount / (double)totalEntries > 0.1) {
            LOGGER.info("entries not uniform because too many duplicates");
            return false;
        } else if (!tableDuplicateCheck && (double)duplicateWordCount / (double)duplicateCountSet.size() > 0.6) {
            LOGGER.info("entries not uniform because too many duplicate words");
            return false;
        }
        // if ((double) missingEntries / (double) totalEntries > 0.1) {
        // LOGGER.info("entries not uniform because too many entries are missing");
        // return false;
        // }

        return true;
    }

    public  ListDiscoverer();

}