Skip to content

Instantly share code, notes, and snippets.

@kmaher9
Created August 24, 2018 21:28
Show Gist options
  • Save kmaher9/1e37450c19e9d59ad8925566f1c6a32f to your computer and use it in GitHub Desktop.
Save kmaher9/1e37450c19e9d59ad8925566f1c6a32f to your computer and use it in GitHub Desktop.
func learn(classifier *bayesian.Classifier) {
classifier.Learn(businessFiles, Business)
classifier.Learn(techFiles, Tech)
}
func enumerateClasses() {
businessDirectory := enumerateDirectory(businessDirectoryLocation) // retrieves a list of all filenames stored in the directory.
for _, file := range businessDirectory {
fileContent := readFile(file) // returns the entire contents of the files as a string.
businessFiles = append(businessFiles, fileContent)
}
techDirectory := enumerateDirectory(techDirectoryLocation)
for _, file := range techDirectory {
fileContent := readFile(file)
techFiles = append(techFiles, fileContent)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment