Skip to content
Snippets Groups Projects
Select Git revision
  • a78c544808a4af594de962c3bad89ef94d67a383
  • master default protected
  • 49-fix-end-game
  • 40-improve-app-metadata
  • 12-improve-layout
  • 4-add-animations
  • Release_0.9.1_47 protected
  • Release_0.9.0_46 protected
  • Release_0.8.2_45 protected
  • Release_0.8.1_44 protected
  • Release_0.8.0_43 protected
  • Release_0.7.0_42 protected
  • Release_0.6.0_41 protected
  • Release_0.5.0_40 protected
  • Release_0.4.2_39 protected
  • Release_0.4.1_38 protected
  • Release_0.4.0_37 protected
  • Release_0.3.1_36 protected
  • Release_0.3.0_35 protected
  • Release_0.2.1_34 protected
  • Release_0.2.0_33 protected
  • Release_0.1.2_32 protected
  • Release_0.1.1_31 protected
  • Release_0.1.0_30 protected
  • Release_0.0.29_29 protected
  • Release_0.0.28_28 protected
26 results

words_lists_stats.sh

Blame
  • words_lists_stats.sh 907 B
    #!/usr/bin/env bash
    
    CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
    PROJECT_DIR="$(dirname "${CURRENT_DIR}")"
    
    ASSETS_FOLDER="${PROJECT_DIR}/assets/files"
    
    for LANG in fr
    do
        echo "${LANG}"
        for LENGTH in 4 5 6 7 8
        do
            echo "${LANG} ${LENGTH}"
            for TYPE in dictionary easy normal
            do
                FILE="${ASSETS_FOLDER}/words-${LENGTH}-${LANG}-${TYPE}.txt"
    
                # Get errors
                PATTERN='^[A-Z]{'"${LENGTH}"'}$'
                ERRORS="$(cat "${FILE}" | grep -v -E "${PATTERN}")"
    
                # Force fix/clean file
                TMP="${FILE}.tmp"
                cat "${FILE}" | tr a-z A-Z | grep -E "${PATTERN}" | sort | uniq > "${TMP}"
                mv "${TMP}" "${FILE}"
    
                # Count
                COUNT="$(cat "${FILE}" | wc -l | awk '{print $1}')"
                echo "${LANG} ${LENGTH} ${TYPE} => ${COUNT}"
            done
        done
    done