diff --git a/engine/config.go b/engine/config.go index 5becee6..890dce1 100644 --- a/engine/config.go +++ b/engine/config.go @@ -82,6 +82,5 @@ func (self *Configuration) IntArray(key string, def []int) []int { } func (self *Configuration) GetRandomUUID() string { - u, _ := uuid.NewV4() - return u.String() + return uuid.NewV4().String() } diff --git a/nlp/accents.go b/nlp/accents.go index a50fdaa..611ce49 100644 --- a/nlp/accents.go +++ b/nlp/accents.go @@ -6,7 +6,7 @@ type Accent struct { who AccentsModule } -//Create the appropriate accents module (according to received options), and create a wrapper to access it. +// Create the appropriate accents module (according to received options), and create a wrapper to access it. func NewAccent(lang string) *Accent { this := Accent{} if lang == "es" { @@ -21,7 +21,7 @@ func NewAccent(lang string) *Accent { return &this } -//Wrapper methods: just call the wrapped accents module. +// Wrapper methods: just call the wrapped accents module. func (this *Accent) FixAccentutation(candidates *set.Set, suf *sufrule) { this.who.FixAccentuation(candidates, suf) } diff --git a/nlp/preftree.go b/nlp/preftree.go index 4dfabc8..2abdeb7 100644 --- a/nlp/preftree.go +++ b/nlp/preftree.go @@ -12,59 +12,59 @@ func NewList() *List { } /* -func (this *List) push(c rune, wordEnd bool) interface {} { - n := this.find(c) - if n == nil { - if !wordEnd { - n = NewListRecBase(c) - } else { - n = NewListRecBase(c) - } + func (this *List) push(c rune, wordEnd bool) interface {} { + n := this.find(c) + if n == nil { + if !wordEnd { + n = NewListRecBase(c) + } else { + n = NewListRecBase(c) + } - if this.end != nil { - this.end.next = n - } else { - this.begin = n - } - this.end = n - } else if wordEnd { - tmp := this.begin - var prev *ListRecBase = nil - for tmp != n { - prev = tmp - tmp = tmp.next - } + if this.end != nil { + this.end.next = n + } else { + this.begin = n + } + this.end = n + } else if wordEnd { + tmp := this.begin + var prev *ListRecBase = nil + for tmp != n { + prev = tmp + tmp = tmp.next + } - if n == this.end { - this.end = nil - } + if n == this.end { + this.end = nil + } - ntmp := n.next - l := n.nextList - n = NewListRecData(c) - n.next = ntmp - n.nextList = l + ntmp := n.next + l := n.nextList + n = NewListRecData(c) + n.next = ntmp + n.nextList = l - if prev != nil { - prev.next = n - } else { - this.begin = n - } + if prev != nil { + prev.next = n + } else { + this.begin = n + } - if this.end == nil { - this.end = n + if this.end == nil { + this.end = n + } } - } - if !wordEnd { - if n.nextList == nil { - n.nextList = NewList() + if !wordEnd { + if n.nextList == nil { + n.nextList = NewList() + } + return n.nextList + } else { + return n } - return n.nextList - } else { - return n } -} */ func (this *List) find(c rune) *ListRecBase { if this.begin == nil { diff --git a/terminal/terminal.go b/terminal/terminal.go index e0ff2ca..f35eb4c 100644 --- a/terminal/terminal.go +++ b/terminal/terminal.go @@ -70,9 +70,9 @@ func Errorf(message string, params ...interface{}) { } func ErrorI(messages ...interface{}) { - red.Print(messages) + red.Print(messages...) } func ErrorIln(messages ...interface{}) { - red.Println(messages) + red.Println(messages...) }