-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make methods and internal documentation consistent between htk and te…
…xtgrid.
- Loading branch information
Showing
7 changed files
with
141 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
package htk | ||
|
||
// Annotation contains a starting and ending time in seconds, with a text label. | ||
// Annotation structs contain a starting and ending time in seconds, with a text label. | ||
type Annotation struct { | ||
start float64 | ||
end float64 | ||
label string | ||
} | ||
|
||
// GetDuration gets the total duration of an annotation. | ||
// GetDuration gets the total duration of an Annotation. | ||
func (annotation *Annotation) GetDuration() (result float64) { | ||
return annotation.end - annotation.start | ||
} | ||
|
||
// GetStart gets the start time of an annotation. | ||
// GetStart gets the start time of an Annotation. | ||
func (annotation *Annotation) GetStart() float64 { | ||
return annotation.start | ||
} | ||
|
||
// SetStart sets the start time of an annotation. | ||
// SetStart sets the start time of an Annotation. | ||
func (annotation *Annotation) SetStart(start float64) { | ||
annotation.start = start | ||
} | ||
|
||
// GetEnd gets the end time of an annotation. | ||
// GetEnd gets the end time of an Annotation. | ||
func (annotation *Annotation) GetEnd() float64 { | ||
return annotation.end | ||
} | ||
|
||
// SetEnd sets the end time of an annotation. | ||
// SetEnd sets the end time of an Annotation. | ||
func (annotation *Annotation) SetEnd(end float64) { | ||
annotation.end = end | ||
} | ||
|
||
// GetLabel gets the label of an annotation. | ||
// GetLabel gets the label of an Annotation. | ||
func (annotation *Annotation) GetLabel() string { | ||
return annotation.label | ||
} | ||
|
||
// SetLabel sets the label of an annotation | ||
// SetLabel sets the label of an Annotation. | ||
func (annotation *Annotation) SetLabel(label string) { | ||
annotation.label = label | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
package textgrid | ||
|
||
// Point - A point is a specific time marker with a string value. | ||
// Point structs are annotations that represent a specific point in time, with a text label. | ||
type Point struct { | ||
value float64 | ||
mark string | ||
} | ||
|
||
// GetValue - Returns the time value of the point. | ||
// GetValue returns value of a Point. | ||
func (point *Point) GetValue() float64 { | ||
return point.value | ||
} | ||
|
||
// GetMark - Returns the label mark of the point. | ||
// GetMark returns the text label of a Point. | ||
func (point *Point) GetMark() string { | ||
return point.mark | ||
} | ||
|
||
// SetValue - Sets the value of the point. | ||
// SetValue sets the value of a Point. | ||
func (point *Point) SetValue(value float64) { | ||
point.value = value | ||
} | ||
|
||
// SetMark - Sets the label mark of the point. | ||
// SetMark sets the mark of a Point. | ||
func (point *Point) SetMark(mark string) { | ||
point.mark = mark | ||
} |
Oops, something went wrong.