Browse Source

improved words analysis, punctuation symbols filtered

master
arnaucode 7 years ago
parent
commit
789235bcbb
4 changed files with 9 additions and 1 deletions
  1. +8
    -0
      analyzeWords.go
  2. BIN
      argos
  3. BIN
      build/argos
  4. +1
    -1
      main.go

+ 8
- 0
analyzeWords.go

@ -11,7 +11,15 @@ func mapWords(text string, words map[string]int) map[string]int {
s := strings.Split(text, " ")
for _, v := range s {
//first, remove punctuation symbols
v = strings.Replace(v, ":", "", -1)
v = strings.Replace(v, ",", "", -1)
v = strings.Replace(v, ".", "", -1)
v = strings.Replace(v, "!", "", -1)
v = strings.Replace(v, "?", "", -1)
v = strings.Replace(v, "\n", "", -1)
if _, ok := words[v]; ok {
fmt.Println(v)
words[v] = words[v] + 1
} else {
words[v] = 1

BIN
argos


BIN
build/argos


+ 1
- 1
main.go

@ -7,7 +7,7 @@ import (
"strings"
)
const version = "0.2-beta"
const version = "0.3-beta"
const minNumWords = 10
const minNumHashtag = 2
const minNumUserInteractions = 1

Loading…
Cancel
Save