code: func GenerateCorpus(sentenceTags []treebank.SentenceTag) *Corpus {
  	words := make([]string, 3)
  	frequencies := make([]int, 3)
  
  	words[0] = ""      // aka NULL, for when no word can be found
  	frequencies[0] = 0 // no word is never found
  
  	words[1] = "-UNKNOWN-"
  	frequencies[1] = 0
  
  	words[2] = "-ROOT-"
  	frequencies[2] = 1
  
  	knownWords := make(map[string]int)
  	knownWords[""] = 0
  	knownWords["-UNKNOWN-"] = 1
  	knownWords["-ROOT-"] = 2
  
  	maxWordLength := 0
  
  	for _, sentenceTag := range sentenceTags {
  		for _, lex := range sentenceTag.Sentence {
  			id, ok := knownWords[lex.Value]
  			if !ok {
  				knownWords[lex.Value] = len(words)
  				words = append(words, lex.Value)
  				frequencies = append(frequencies, 1)
  
  				runeCount := utf8.RuneCountInString(lex.Value)
  				if runeCount > maxWordLength {
  					maxWordLength = runeCount
  				}
  			} else {
  				frequencies[id]++
  			}
  		}
  	}
  
  	var totals int
  	for _, f := range frequencies {
  		totals += f
  	}
  
  	return &Corpus{words, frequencies, knownWords, int64(len(words)), totals, maxWordLength}
  }
docs: // GenerateCorpus creates a Corpus given a set of SentenceTag from a training set.