<commit_before>%%%
%%% Authors:
%%%   <NAME> (<EMAIL>)
%%%   <NAME> <<EMAIL>>
%%%
%%% Copyright:
%%%   <NAME>, 1997
%%%   <NAME>, 1997
%%%
%%% Last change:
%%%   $Date$ by $Author$
%%%   $Revision$
%%%
%%% This file is part of Mozart, an implementation
%%% of Oz 3
%%%    http://www.mozart-oz.org
%%%
%%% See the file "LICENSE" or
%%%    http://www.mozart-oz.org/LICENSE.html
%%% for information on usage and redistribution
%%% of this file, and for a DISCLAIMER OF ALL
%%% WARRANTIES.
%%%

%%
%% Module
%%

fun {IsString Is}
   case Is
   of I|Ir then
      {IsChar I} andthen {IsString Ir}
   [] nil then
      true
   else
      false
   end
end

fun {StringToAtom Is}
   if {IsString Is} then
      {VirtualString.toAtom Is}
   else
      raise typeError('String' Is) end
   end
end

local
   HexBase = base(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7 &8:8 &9:9
                  &A:10 &B:11 &C:12 &D:14 &E:15
                  &a:10 &b:11 &c:12 &d:14 &e:15)

   DecBase = base(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7 &8:8 &9:9)
   OctBase = base(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7)
   BinBase = base(&0:0 &1:1)

   fun {RaiseStringNoInt Is}
      {Exception.raiseError kernel(stringNoInt Is)}
      unit
   end

   fun {StringToIntBase Base BaseRec Is OriginalIs Acc IsFirst}
      case Is
      of nil then
         if IsFirst then<commit_msg>Fixed a bug in String.toInt with hex numbers.<commit_after>%%%
%%% Authors:
%%%   <NAME> (<EMAIL>)
%%%   <NAME> <<EMAIL>>
%%%
%%% Copyright:
%%%   <NAME>, 1997
%%%   <NAME>, 1997
%%%
%%% Last change:
%%%   $Date$ by $Author$
%%%   $Revision$
%%%
%%% This file is part of Mozart, an implementation
%%% of Oz 3
%%%    http://www.mozart-oz.org
%%%
%%% See the file "LICENSE" or
%%%    http://www.mozart-oz.org/LICENSE.html
%%% for information on usage and redistribution
%%% of this file, and for a DISCLAIMER OF ALL
%%% WARRANTIES.
%%%

%%
%% Module
%%

fun {IsString Is}
   case Is
   of I|Ir then
      {IsChar I} andthen {IsString Ir}
   [] nil then
      true
   else
      false
   end
end

fun {StringToAtom Is}
   if {IsString Is} then
      {VirtualString.toAtom Is}
   else
      raise typeError('String' Is) end
   end
end

local
   HexBase = base(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7 &8:8 &9:9
                  &A:10 &B:11 &C:12 &D:13 &E:14 &F:15
                  &a:10 &b:11 &c:12 &d:13 &e:14 &f:15)

   DecBase = base(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7 &8:8 &9:9)
   OctBase = base(&0:0 &1:1 &2:2 &3:3 &4:4 &5:5 &6:6 &7:7)
   BinBase = base(&0:0 &1:1)

   fun {RaiseStringNoInt Is}
      {Exception.raiseError kernel(stringNoInt Is)}
      unit
   end

   fun {StringToIntBase Base BaseRec Is OriginalIs Acc IsFirst}
      case Is
      of nil then
         if IsFirst then
{'fraction_non_alphanumeric': 0.18075801749271136, 'fraction_numerical': 0.0663265306122449, 'mean_word_length': 2.6502659574468086, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1645414', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1126, 'n_words': 322}