diff --git a/dot_zsh_aliases b/dot_zsh_aliases index 4e51f4f..7eaf10b 100644 --- a/dot_zsh_aliases +++ b/dot_zsh_aliases @@ -80,6 +80,8 @@ alias hist='history' alias codestats='tokei' alias dups='file_dups' alias pairs='file_getpairs' +alias filter_pairs="tr '[:upper:]' '[:lower:]' | \grep -o -E '\w{3,} \w{3,}' | \grep --invert-match --word-regexp --fixed-strings --file=\"\$HOME/stopwords.txt\" | \sed 's/s$//g' | \sed 's/ing$//g' | sort | uniq -c | sort --numeric-sort --reverse" +alias sort_count="sort | uniq -c | sort --numeric-sort --reverse" alias words='file_getwords' alias fd="\fd" alias wiki='wikit' diff --git a/dot_zsh_functions b/dot_zsh_functions index 57f1e47..8d70c02 100644 --- a/dot_zsh_functions +++ b/dot_zsh_functions @@ -467,14 +467,14 @@ function dl_stopwords() { } function file_getwords() { dl_stopwords - \cat "$1" | tr '[:upper:]' '[:lower:]' | \grep -o -E '\w{3,}' | \grep --invert-match --word-regexp --fixed-strings --file="$HOME/stopwords.txt" | \sed 's/s$//g' | \sed 's/ing$//g' | sort | uniq -c | sort --numeric-sort --reverse + \cat "$1" | tr '[:upper:]' '[:lower:]' | \grep -o -E '\w{3,}' | \grep --invert-match --word-regexp --fixed-strings --file="$HOME/stopwords.txt" | \sed 's/s$//g' | \sed 's/ing$//g' | sort_count } function file_getpairs() { dl_stopwords - \cat "$1" | tr '[:upper:]' '[:lower:]' | \grep -o -E '\w{3,} \w{3,}' | \grep --invert-match --word-regexp --fixed-strings --file="$HOME/stopwords.txt" | \sed 's/s$//g' | \sed 's/ing$//g' | sort | uniq -c | sort --numeric-sort --reverse + \cat "$1" | filter_pairs } function file_dups() { - \cat "$1" | sort | uniq -c | sort -nr + \cat "$1" | sort_count } function foreach_run() { find . -name "$1" -exec "$2" {} \;