<commit_before>#!/bin/bash
# This CI acceptance test is based on:
# https://github.com/jsoref/spelling/blob/04648bdc63723e5cdf5cbeaff2225a462807abc8
# It is conceptually `f` which runs `w` (spelling-unknown-word-splitter)
# plus `fchurn` which uses `dn` mostly rolled together.
set -e

spellchecker=.ci/jsoref-spellchecker
whitelist_path=.ci/jsoref-spellchecker/whitelist.words
dict=$spellchecker/english.words
word_splitter=$spellchecker/spelling-unknown-word-splitter.pl
run_output=$spellchecker/unknown.words
if [ ! -e $dict ]; then
  echo "Retrieve ./usr/share/dict/linux.words"
  words_rpm=$spellchecker/words.rpm
  URL_PART1="https://rpmfind.net/linux/fedora/linux/development/rawhide/"
  URL_PART2="Everything/aarch64/os/Packages/w/words-3.0-29.fc29.noarch.rpm"
  curl $URL_PART1$URL_PART2 > $words_rpm
  $spellchecker/rpm2cpio.sh $words_rpm |\
    cpio -i --to-stdout ./usr/share/dict/linux.words > $dict
  rm $words_rpm
fi

if [ ! -e $word_splitter ]; then
  echo "Retrieve w"
  curl -s https://raw.githubusercontent.com/jsoref/spelling/master/w |\
    perl -p -n -e "s</usr/share/dict/words><$dict>" > $word_splitter
  chmod u+x $word_splitter
  echo "Retrieved."
  ls -la $word_splitter
fi

echo "Clean up from previous run"
rm -f $run_output

echo "Run w"
(git 'ls-files' -z 2> /dev/null || hg locate -0) |\
  .ci/jsoref-spellchecker/exclude.pl |\
  xargs -0 $word_splitter |\
  $word_splitter |\
  perl -p -n -e 's/ \(.*//' > $run_output
<commit_msg>minor: update words file version as work around for #6046<commit_after>#!/bin/bash
# This CI acceptance test is based on:
# https://github.com/jsoref/spelling/blob/04648bdc63723e5cdf5cbeaff2225a462807abc8
# It is conceptually `f` which runs `w` (spelling-unknown-word-splitter)
# plus `fchurn` which uses `dn` mostly rolled together.
set -e

spellchecker=.ci/jsoref-spellchecker
whitelist_path=.ci/jsoref-spellchecker/whitelist.words
dict=$spellchecker/english.words
word_splitter=$spellchecker/spelling-unknown-word-splitter.pl
run_output=$spellchecker/unknown.words
if [ ! -e $dict ]; then
  echo "Retrieve ./usr/share/dict/linux.words"
  words_rpm=$spellchecker/words.rpm
  URL_PART1="https://rpmfind.net/linux/fedora/linux/development/rawhide/"
  URL_PART2="Everything/aarch64/os/Packages/w/words-3.0-30.fc29.noarch.rpm"
  curl $URL_PART1$URL_PART2 > $words_rpm
  $spellchecker/rpm2cpio.sh $words_rpm |\
    cpio -i --to-stdout ./usr/share/dict/linux.words > $dict
  rm $words_rpm
fi

if [ ! -e $word_splitter ]; then
  echo "Retrieve w"
  curl -s https://raw.githubusercontent.com/jsoref/spelling/master/w |\
    perl -p -n -e "s</usr/share/dict/words><$dict>" > $word_splitter
  chmod u+x $word_splitter
  echo "Retrieved."
  ls -la $word_splitter
fi

echo "Clean up from previous run"
rm -f $run_output

echo "Run w"
(git 'ls-files' -z 2> /dev/null || hg locate -0) |\
  .ci/jsoref-spellchecker/exclude.pl |\
  xargs -0 $word_splitter |\
  $word_splitter |\
  perl -p -n -e 's/ \(.*//' > $run_output

{'fraction_non_alphanumeric': 0.14814814814814814, 'fraction_numerical': 0.027609427609427608, 'mean_word_length': 3.968227424749164, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, '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': '5375667', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1180, 'n_words': 231}