File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 "io/ioutil"
66 "os"
7+ "path/filepath"
78 "regexp"
89 "sort"
910 "strings"
@@ -18,16 +19,16 @@ func main() {
1819 t := time .Now ()
1920 defer timeTrack (t )
2021
21- outdir := "./ words"
22+ outdir := "words"
2223 os .RemoveAll (outdir )
2324 os .Mkdir (outdir , 0777 )
2425
2526 paths , _ := doublestar .Glob ("../data/pl/**/*.yml" )
2627 for _ , path := range paths {
27- yaml := GetYAML ( path )
28- outfilepath := fmt . Sprintf ( "%s/words-for-%s.txt" , outdir , yaml . Label )
29- fmt .Printf ( "Processing %s ... \n " , outfilepath )
30-
28+ fmt . Println ( filepath . Base ( path ) )
29+ meta := GetYAML ( path )
30+ outfilepath := fmt .Sprintf ( "%s/extracted-words-for-%s.txt " , outdir , meta . Code )
31+
3132 // load file content
3233 filepath := strings .Replace (path , ".yml" , ".txt" , - 1 )
3334 content , _ := ioutil .ReadFile (filepath )
Original file line number Diff line number Diff line change 44import re
55import yaml
66import shutil
7+ import time
8+
9+ t = time .time ()
710
811with_sorting = False
912
2528 if with_sorting :
2629 words = sorted (words , key = collator .getSortKey )
2730 file .write ("\n " .join (words ))
31+
32+ print ("Total timing: " , time .time () - t )
You can’t perform that action at this time.
0 commit comments