Created
August 24, 2018 21:28
-
-
Save kmaher9/1e37450c19e9d59ad8925566f1c6a32f to your computer and use it in GitHub Desktop.
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
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