<commit_before>%%% ocs_wm_config.erl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @copyright 2016 SigScale Global Inc.
%%% @end
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%%     http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @doc This library module implements the configuration of dispatching
%%% 	in the {@link //webmachine. webmachine} application for URIs within
%%%   the {@link //oss_gw. oss_gw} application's REST API.
%%%
-module(ocs_wm_config).
-copyright('Copyright (c) 2016 SigScale Global Inc.').

-export([dispatch/0]).

-spec dispatch() -> [tuple()].
%% @doc Returns the dispatch map tuples for {@link //webmachine. webmachine}.
dispatch() ->
	{TraceResource, Args} = case application:get_env(rest_trace) of
		{ok, Dir}  ->
			Res = [{["wmtrace", '*'], wmtrace_resource, [{trace_dir, Dir}]}],
			case file:make_dir(Dir) of
				ok ->
					{Res, [{trace, Dir}]};
				{error, eexist} ->
					{Res, [{trace, Dir}]};
				{error, Reason} ->
					error_logger:warning_report(["REST trace",
							{rest_trace, Dir}, {error, Reason}]),
					{[], []}
			end;
		undefined ->
			{[], []}
	end,
	[{["subscriber"], ocs_wm_res_subscriber, Args},
	 {["subscriber", name], ocs_wm_res_subscriber, Args}] ++ TraceResource.
<commit_msg>allign dispatcher uris with TMForum frameworx specifiction<commit_after>%%% ocs_wm_config.erl
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @copyright 2016 SigScale Global Inc.
%%% @end
%%% Licensed under the Apache License, Version 2.0 (the "License");
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%%%
%%%     http://www.apache.org/licenses/LICENSE-2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
%%% distributed under the License is distributed on an "AS IS" BASIS,
%%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%%% See the License for the specific language governing permissions and
%%% limitations under the License.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @doc This library module implements the configuration of dispatching
%%% 	in the {@link //webmachine. webmachine} application for URIs within
%%%   the {@link //oss_gw. oss_gw} application's REST API.
%%%
-module(ocs_wm_config).
-copyright('Copyright (c) 2016 SigScale Global Inc.').

-export([dispatch/0]).

-spec dispatch() -> [tuple()].
%% @doc Returns the dispatch map tuples for {@link //webmachine. webmachine}.
dispatch() ->
	{TraceResource, Args} = case application:get_env(rest_trace) of
		{ok, Dir}  ->
			Res = [{["wmtrace", '*'], wmtrace_resource, [{trace_dir, Dir}]}],
			case file:make_dir(Dir) of
				ok ->
					{Res, [{trace, Dir}]};
				{error, eexist} ->
					{Res, [{trace, Dir}]};
				{error, Reason} ->
					error_logger:warning_report(["REST trace",
							{rest_trace, Dir}, {error, Reason}]),
					{[], []}
			end;
		undefined ->
			{[], []}
	end,
	[{["ocs", "subscriber"], ocs_wm_res_subscriber, Args},
	 {["ocs", "subscriber", identity], ocs_wm_res_subscriber, Args}] ++ TraceResource.

{'fraction_non_alphanumeric': 0.2291272629019184, 'fraction_numerical': 0.007025128343690895, 'mean_word_length': 4.634703196347032, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1165425', 'n_tokens_mistral': 1221, 'n_tokens_neox': 1086, 'n_words': 360}