<commit_before>%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
%% 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.

-module(swirl_app).
-include("swirl.hrl").

-behaviour(application).

%% api
-export([version/0]).

%% callbacks
-export([start/2,
         stop/1]).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% api

version() ->
    {ok, Version} = application:get_key(swirl, vsn),
    {?PPSPP_RELEASE, Version}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% callbacks

%% used by application:start/1
start(_Type, _Start_Args) ->
    {Protocol, Version} = version(),
    ?INFO("swirl: protocol ~s~n", [Protocol]),
    ?INFO("swirl: version #~s~n", [Version]),
    case swirl_sup:start_link() of
        {ok, Pid} ->
            {ok, Pid};
        Other ->
            {error, Other}
    end.

stop(_State) ->
    ok.<commit_msg>swirl: add types, fix bugs found by types<commit_after>%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
%% ex: ft=erlang ts=4 sw=4 et
%% 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.

-module(swirl_app).
-include("swirl.hrl").

-behaviour(application).

%% api
-export([version/0]).

%% callbacks
-export([start/2,
         stop/1]).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% api

-spec version() -> {string(), string()}.
version() ->
    {ok, Version} = application:get_key(swirl, vsn),
    {?PPSPP_RELEASE, Version}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% callbacks

%% used by application:start/1
-spec start(_ ,_ ) -> {ok, pid()} | {error,_ }.
start(_Type, _Start_Args) ->
    {Protocol, Version} = version(),
    ?INFO("swirl: protocol ~s~n", [Protocol]),
    ?INFO("swirl: version #~s~n", [Version]),
    swirl_sup:start_link().

-spec stop(_) -> ok.
stop(_State) ->
    ok.
{'fraction_non_alphanumeric': 0.24762872628726287, 'fraction_numerical': 0.008130081300813009, 'mean_word_length': 4.1625874125874125, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, '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': '761432', 'n_tokens_mistral': 879, 'n_tokens_neox': 849, 'n_words': 276}