<commit_before>#!/bin/sh

base_dir=$(dirname $0)

if [ 1 != $# -a 2 != $# ]; then
  echo "usage: $0 db_path [edict.gz_path]"
  exit 1
fi

if [ -z $2 ]; then
    edict_gz=edict.gz
    if [ ! -f $edict_gz ]; then
	wget -O $edict_gz http://ftp.monash.edu.au/pub/nihongo/edict.gz
    fi
else
    edict_gz=$2
fi

if type gzcat > /dev/null 2>&1; then
    zcat='gzcat'
else
    zcat='zcat'
fi

if $zcat $edict_gz | ${base_dir}/edict2grn.rb | groonga $1 > /dev/null; then
  echo "edict data loaded."
fi<commit_msg>example dictionary: use double quote for string literal<commit_after>#!/bin/sh

base_dir=$(dirname $0)

if [ 1 != $# -a 2 != $# ]; then
  echo "usage: $0 db_path [edict.gz_path]"
  exit 1
fi

if [ -z $2 ]; then
    edict_gz=edict.gz
    if [ ! -f $edict_gz ]; then
	wget -O $edict_gz http://ftp.monash.edu.au/pub/nihongo/edict.gz
    fi
else
    edict_gz=$2
fi

if type gzcat > /dev/null 2>&1; then
    zcat="gzcat"
else
    zcat="zcat"
fi

if $zcat $edict_gz | ${base_dir}/edict2grn.rb | groonga $1 > /dev/null; then
  echo "edict data loaded."
fi
{'fraction_non_alphanumeric': 0.16603415559772297, 'fraction_numerical': 0.020872865275142316, 'mean_word_length': 2.9365671641791047, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, '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': '2966448', 'n_tokens_mistral': 483, 'n_tokens_neox': 468, 'n_words': 118}