File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ The following results are for 123 unique utf-8 Bible text files in 23 languages
16162. Python 3.10.2 = 2.80s
17173. Julia 1.7.1 = 4.522
18184. Crystal 1.3.2 = 5.72s
19- 5. Elixir 1.13.2 = 8.37s
19+ 5. Elixir 1.13.2 = 7.82s
20206. Ruby 3.1.0 = 8.31s
2121
2222Golang 1.17 = UNDER REFACTORING, stay tuned
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ use Timex
33defmodule WordsExtractor do
44 @ moduledoc nil
55
6+ @ pat Regex . compile! ( "[\W \d ]+/u" )
7+
68 def run do
79 outdir = "words"
810 File . rm_rf! ( outdir )
@@ -31,7 +33,6 @@ defmodule WordsExtractor do
3133
3234 def worker ( { path , i } , outdir , count ) do
3335 % { "code" => code , "lang" => lang } = YamlElixir . read_from_file! ( path )
34- pat = Regex . compile! ( "[\W \d ]+/u" )
3536
3637 filepath = String . replace ( path , ".yml" , ".txt" )
3738 % File.Stat { :size => filesize } = File . stat! ( filepath )
@@ -40,7 +41,7 @@ defmodule WordsExtractor do
4041 File . read! ( filepath )
4142 |> String . downcase ( )
4243 |> String . trim ( )
43- |> then ( & Regex . split ( pat , & 1 ) )
44+ |> then ( & Regex . split ( @ pat , & 1 ) )
4445 |> MapSet . new ( )
4546 |> Enum . join ( "\n " )
4647
You can’t perform that action at this time.
0 commit comments