<commit_before>#!/bin/sh

# Transform select osrm-text-instructions language files from json to plist
git submodule init
git submodule update
cd "./osrm-text-instructions/languages/translations/" || exit 1

for file in ./*; do
    if [ "$file" = "./en.json" ]; then
      LANGUAGE="Base"
    else
      # skip not-supported languages
      LANGUAGE=$(basename $file)
      LANGUAGE=${LANGUAGE%.json}
    fi

    if [ "$LANGUAGE" != "skip" ]; then
      LANGUAGE_DIR="${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${LANGUAGE}.lproj"
      mkdir -p "${LANGUAGE_DIR}"
      plutil -convert xml1 "./${file}" -o "${LANGUAGE_DIR}/Instructions.plist"
    fi
done

cd - || exit 1<commit_msg>Put plists in source directory in absence of build directory<commit_after>#!/bin/sh

# Transform select osrm-text-instructions language files from json to plist
git submodule init
git submodule update
cd "./osrm-text-instructions/languages/translations/" || exit 1

for file in ./*; do
    if [ "$file" = "./en.json" ]; then
      LANGUAGE="Base"
    else
      # skip not-supported languages
      LANGUAGE=$(basename $file)
      LANGUAGE=${LANGUAGE%.json}
    fi

    if [ "$LANGUAGE" != "skip" ]; then
      LANGUAGE_DIR="${BUILT_PRODUCTS_DIR:-../../../OSRMTextInstructions/}/${UNLOCALIZED_RESOURCES_FOLDER_PATH:-}/${LANGUAGE}.lproj"
      mkdir -p "${LANGUAGE_DIR}"
      plutil -convert xml1 "./${file}" -o "${LANGUAGE_DIR}/Instructions.plist"
    fi
done

cd - || exit 1
{'fraction_non_alphanumeric': 0.1493550577053632, 'fraction_numerical': 0.004073319755600814, 'mean_word_length': 3.260115606936416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '3545356', 'n_tokens_mistral': 525, 'n_tokens_neox': 494, 'n_words': 120}