generated from stscoundrel/go-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.go
73 lines (58 loc) · 1.65 KB
/
debug.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package main
import (
"fmt"
"github.com/stscoundrel/old-swedish-dictionary-builder/dictionary"
)
func debug() {
entries, entries1, entries2 := dictionary.GetOldSwedishDictionary()
var hasPartOfSpeech int = 0
var doesNothHavePartOfSpeech int = 0
var hasGrammaticalAspect int = 0
var doesNothHaveGrammaticalAspect int = 0
var hasInformation int = 0
var doesNotHaveInformation int = 0
fmt.Println(len(entries1))
fmt.Println(len(entries2))
fmt.Println(len(entries))
for _, entry := range entries {
fmt.Println("Headword: " + entry.Headword)
fmt.Println("GrammaticalAspect: " + entry.GrammaticalAspect)
fmt.Println("PartOfSpeech: ")
for _, partOfSpeech := range entry.PartOfSpeech {
fmt.Println(partOfSpeech)
}
fmt.Println("Definitions:")
for _, definition := range entry.Definitions {
fmt.Println(definition)
}
fmt.Println("Alternative forms:")
for _, alternativeForm := range entry.AlternativeForms {
fmt.Println(alternativeForm)
}
fmt.Println("########################")
if len(entry.PartOfSpeech) > 0 {
hasPartOfSpeech += 1
} else {
doesNothHavePartOfSpeech += 1
}
if entry.GrammaticalAspect == "" {
hasGrammaticalAspect += 1
} else {
doesNothHaveGrammaticalAspect += 1
}
if entry.Information == "" {
hasInformation += 1
} else {
doesNotHaveInformation += 1
}
}
fmt.Println("PART OF SPEECH STATS")
fmt.Println(hasPartOfSpeech)
fmt.Println(doesNothHavePartOfSpeech)
fmt.Println("GRAMMATICAL ASPECT STATS")
fmt.Println(hasGrammaticalAspect)
fmt.Println(doesNothHaveGrammaticalAspect)
fmt.Println("INFORMATION STATS")
fmt.Println(hasInformation)
fmt.Println(doesNotHaveInformation)
}