arnaucube
arnaucube/flock-botnetPublic Self-hosted repository
flock-botnet/optionTweetMarkov.go
optionTweetMarkov.goRaw
 1package main
 2
 3import (
 4	"bufio"
 5	"fmt"
 6	"os"
 7	"strconv"
 8	"strings"
 9)
10
11func optionTweetMarkov(states []State) {
12
13	fmt.Print("entry the first word: ")
14	newcommand := bufio.NewReader(os.Stdin)
15	firstWord, _ := newcommand.ReadString('\n')
16	firstWord = strings.TrimSpace(firstWord)
17	fmt.Print("first word: ")
18	c.Purple(firstWord)
19
20	c.Red("how many words you want on the text?")
21	newcommand = bufio.NewReader(os.Stdin)
22	answer, _ := newcommand.ReadString('\n')
23	answer = strings.TrimSpace(answer)
24	fmt.Print("Number of words on text to generate: ")
25	c.Purple(answer)
26	count, err := strconv.Atoi(answer)
27	if err != nil {
28		fmt.Println("incorrect entry, need a positive number")
29	}
30
31	c.Red("how many sentences you want to generate?")
32	newcommand = bufio.NewReader(os.Stdin)
33	answer, _ = newcommand.ReadString('\n')
34	answer = strings.TrimSpace(answer)
35	fmt.Print("Number of sentences to generate: ")
36	c.Purple(answer)
37	sentences, err := strconv.Atoi(answer)
38	if err != nil {
39		fmt.Println("incorrect entry, need a positive number")
40	}
41
42	fmt.Println("generating text")
43	for i := 0; i < sentences; i++ {
44		generatedText := markov.generateText(states, firstWord, count)
45		c.Green(generatedText)
46	}
47}