Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Vocabulary ¶
type Vocabulary struct {
// contains filtered or unexported fields
}
Vocabulary stores ID-term bidirectional associations.
func FromJSONFile ¶
func FromJSONFile(filename string) (*Vocabulary, error)
FromJSONFile reads a vocabulary from JSON file.
func (*Vocabulary) AddTerm ¶
func (v *Vocabulary) AddTerm(term string)
AddTerm adds a new term to the vocabulary. If the term does not yet exist in the vocabulary, a new ID is associated to it, corresponding to the current vocabulary size. Otherwise, if the string already exists, no insertion is performed.
func (*Vocabulary) GetID ¶
func (v *Vocabulary) GetID(str string) (int, bool)
GetID returns the ID associated to the given string, and whether it was found.
Click to show internal directories.
Click to hide internal directories.