<commit_before>:- module(
  dcg_option,
  [
    if_option//3, % +Option:compound
                  % +Options:list(compound)
                  % :Dcg
    if_select_option//4 % +Option:compound
                        % +Options:list(compound)
                        % -RestOptions:list(compound)
                        % :Dcg
  ]
).

/** <module> DCG option

Handling of options for DCG rules.

This module is intended to 

@author <NAME>
@version 2015/08
*/

:- use_module(library(option)).

:- meta_predicate(if_option(+,+,//,?,?)).
:- meta_predicate(if_select_option(+,+,-,//,?,?)).





%! if_option(+Option:compound, +Options:list(compound), :Dcg_0)// is det.

if_option(Opt, Opts, Dcg_0) -->
  {option(Opt, Opts)}, !,
  Dcg_0.
if_option(_, _, _) --> [].



%! if_select_option(
%!   +Option:compound,
%!   +Options:list(compound),
%!   -RestOptions:list(compound),
%!   :Dcg_0
%! )// is det.

if_select_option(Opt, Opts1, Opts2, Dcg_0) -->
  {select_option(Opt, Opts1, Opts2)}, !,
  Dcg_0.
if_select_option(_, Opts, Opts, _) --> [].<commit_msg>CLEAN: Renamed if_option//3 -> dcg_if_option//3. CLEAN: Renamed if_select_option//3 -> dcg_if_select_option//3.<commit_after>:- module(
  dcg_option,
  [
    dcg_if_option//3, % +Option:compound
                      % +Options:list(compound)
                      % :Dcg_2
    dcg_if_select_option//4 % +Option:compound
                            % +Options:list(compound)
                            % -RestOptions:list(compound)
                            % :Dcg_2
  ]
).

/** <module> DCG option

Handling of options for DCG rules.

This module is intended to 

@author <NAME>
@version 2015/08, 2015/10
*/

:- use_module(library(option)).

:- meta_predicate(dcg_if_option(+,+,//,?,?)).
:- meta_predicate(dcg_if_select_option(+,+,-,//,?,?)).





%! dcg_if_option(+Option:compound, +Options:list(compound), :Dcg_2)// is det.

dcg_if_option(Option, Options, Dcg_2) -->
  {option(Option, Options)}, !,
  Dcg_2.
dcg_if_option(_, _, _) --> [].



%! dcg_if_select_option(
%!   +Option:compound,
%!   +Options:list(compound),
%!   -RestOptions:list(compound),
%!   :Dcg_2
%! )// is det.

dcg_if_select_option(Opt, Opts1, Opts2, Dcg_2) -->
  {select_option(Opt, Opts1, Opts2)}, !,
  Dcg_2.
dcg_if_select_option(_, Opts, Opts, _) --> [].
{'fraction_non_alphanumeric': 0.18189768255356362, 'fraction_numerical': 0.020988194140795804, 'mean_word_length': 2.643312101910828, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 17, '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': '5252723', 'n_tokens_mistral': 936, 'n_tokens_neox': 891, 'n_words': 134}