minimal changes and readme update
arnaucode idoctnef@openmailbox.org
Sat, 22 Apr 2017 22:23:33 +0200
5 files changed,
9 insertions(+),
4 deletions(-)
M
README.md
→
README.md
@@ -8,3 +8,7 @@ generatedText := markov.generateText(states, firstWord, count)
fmt.Println(generatedText) ``` (in the text variable, goes the text content, can be loaded from a .txt file) + + + +
M
markov.go
→
markov.go
@@ -26,7 +26,7 @@ for i := 0; i < tantPerFourty; i++ {
bar = append(bar, "█") } progressBar := strings.Join(bar, "") - fmt.Printf("\r " + progressBar + " - " + strconv.Itoa(tantPerCent) + "%") + fmt.Printf("\r " + progressBar + " - " + strconv.Itoa(tantPerCent) + "") } func addWordToStates(states []State, word string) ([]State, int) {@@ -70,7 +70,7 @@ for j := 0; j < len(states[i].NextStates); j++ {
states[i].NextStates[j].Prob = (float64(states[i].NextStates[j].Count) / float64(len(words)) * 100) } } - fmt.Println("total words computed: " + strconv.Itoa(len(words))) + fmt.Println("\ntotal words computed: " + strconv.Itoa(len(words))) //fmt.Println(states) return states }@@ -118,7 +118,7 @@ for i := 0; i < count; i++ {
word = getNextMarkovState(states, word) generatedText = append(generatedText, word) } - generatedText = append(generatedText, ".") + //generatedText = append(generatedText, ".") text := strings.Join(generatedText, " ") return text }