Skip to content

Commit 50212ea

Browse files
committed
bug fix in Sprintf format
1 parent f0bac17 commit 50212ea

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

words_extractor_go/main.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
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)

words_extractor_py/words.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import re
55
import yaml
66
import shutil
7+
import time
8+
9+
t = time.time()
710

811
with_sorting = False
912

@@ -25,3 +28,5 @@
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)

0 commit comments

Comments
 (0)