-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaw.go
More file actions
61 lines (53 loc) · 1.52 KB
/
law.go
File metadata and controls
61 lines (53 loc) · 1.52 KB
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
package lawparser
type legalDocument struct {
Name string `json:"name"`
Country string `json:"country"`
State string `json:"state"`
Town string `json:"town"`
Order string `json:"order"` //municipal
LegalCategory string `json:"legalCategory"` //reglamento
Topic string `json:"topic"` //transito
Url string `json:"url"` //transito
Header string `json:"header"`
Footer string `json:"footer"`
Articles []article `json:"articles"`
}
func NewLegalDocument() *legalDocument {
return &legalDocument{}
}
type articles []article
type article struct {
Id string `json:"id"`
Num string `json:"num"`
Parents []parent `json:"parents"`
Headers []subarticle `json:"headers"`
Fractions []fraction `json:"fractions"`
Footers []subarticle `json:"footers"`
}
func (self *article) setParent(p parent) {
self.Parents = append(self.Parents, p)
}
type parent struct {
Order string `json:"order"`
Num string `json:"num"`
Title string `json:"title"`
}
type subarticle struct {
Body string `json:"body"`
Deontic string `json:"deontic"`
Sub []subfraction `json:"sub"`
Punish punishment `json:"punish"`
}
type fraction struct {
subarticle
Num string `json:"num"`
}
type subfraction struct {
Num string `json:"num"`
Body string `json:"body"`
}
type punishment struct {
Type string `json:"type"`
From string `json:"from"`
To string `json:"to"`
}