Skip to content

Commit 8de772a

Browse files
committed
update README and code comments
1 parent 2c41e5a commit 8de772a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
Example of words extracting in Go, Crystal, Rust and Python
44

5-
Text source: 79.4MB in 20 files
5+
Text source: 79.4MB in 30 files
66

77
- Python 3.9.5 with sorting: 11s, without sorting 10s
8-
- Go 1.16.3 with sorting: 30s, without sorting: 20s
8+
- Go 1.16.3 with sorting: 21s, without sorting: 11s
99
- Rust 1.51.0 with sorting: 1m31s, without sorting: 1m10s
1010
- Crystal 1.0.0 with sorting: 2m55s, without sorting: 27s
1111

@@ -19,7 +19,7 @@ cd words_extractor_rs
1919
cargo run
2020
2121
cd words_extractor_go
22-
go run .
22+
make run
2323
2424
cd words_extractor_cr
2525
crystal run src/fast_words_cr.cr

words_extractor_go/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func main() {
3434

3535
// extract and sort unique words
3636
words := extractUniqueWords(content)
37-
words = sortWords(words, "POLISH_CI")
37+
// words = sortWords(words, "POLISH_CI")
3838

3939
text := strings.Join(words, "\n")
4040
for err := ioutil.WriteFile(outfilepath, []byte(text), 0644); err != nil; {

words_extractor_go/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ func Test_extractUniqueWords(t *testing.T) {
1010
text := "ćma cześć ser. śmiech!żółw zebra-łuk len Ćma Żółw ser"
1111
expected := []string{"ćma", "cześć", "ser", "śmiech", "żółw", "zebra", "łuk", "len"}
1212
given := extractUniqueWords([]byte(text))
13-
assert.Equal(t, expected, given, "text should be extracted into unique words")
13+
assert.Equal(t, expected, given, "text should be tokenized into unique words")
1414
}
1515

1616
func Test_sortWords(t *testing.T) {
1717
words := []string{"ćma", "cześć", "ser", "śmiech", "żółw", "zebra", "łuk", "len"}
1818
expected := []string{"cześć", "ćma", "len", "łuk", "ser", "śmiech", "zebra", "żółw"}
1919
given := sortWords(words, "POLISH_CI")
20-
assert.Equal(t, expected, given, "words should be sorted using Polish grammar rule")
20+
assert.Equal(t, expected, given, "words should be sorted out using Polish grammar rules")
2121
}

0 commit comments

Comments
 (0)