<commit_before>:- module(
  compress_ext,
  [
    compress_file/1, % +From
    compress_file/2, % +From, +Compress
    compress_file/3  % +From, +Compress, +To
  ]
).

/** <module> Compress extension

@author <NAME>
@version 2016/01, 2016/03
*/

:- use_module(library(os/file_ext)).
:- use_module(library(zlib)).





%! compress_file(+From) is det.
%! compress_file(+From, +Compress) is det.
%! compress_file(+From, +Compress, +To) is det.
% The following values are supported for Compress:
%   - `deflate’
%   - `gzip’ (default)
%   - `none’

compress_file(From) :-
  compress_file(From, gzip).


compress_file(From, Compress) :-
  thread_file(From, Tmp),
  compress_file(From, Compress, Tmp),
  rename_file(Tmp, From).


compress_file(From, none, To) :- !,
  rename_file(From, To).<commit_msg>DOC: Fix minor typo.<commit_after>:- module(
  compress_ext,
  [
    compress_file/1, % +From
    compress_file/2, % +From, +Compress
    compress_file/3  % +From, +Compress, +To
  ]
).

/** <module> Compress extension

@author <NAME>
@version 2016/01, 2016/03
*/

:- use_module(library(os/file_ext)).
:- use_module(library(zlib)).





%! compress_file(+From) is det.
%! compress_file(+From, +Compress) is det.
%! compress_file(+From, +Compress, +To) is det.
% The following values are supported for Compress:
%   - `deflate'
%   - `gzip' (default)
%   - `none'

compress_file(From) :-
  compress_file(From, gzip).


compress_file(From, Compress) :-
  thread_file(From, Tmp),
  compress_file(From, Compress, Tmp),
  rename_file(Tmp, From).


compress_file(From, none, To) :- !,
  rename_file(From, To).
{'fraction_non_alphanumeric': 0.17010631644777988, 'fraction_numerical': 0.01876172607879925, 'mean_word_length': 3.9535603715170278, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3363394', 'n_tokens_mistral': 659, 'n_tokens_neox': 613, 'n_words': 126}