Skip to content

Commit

Permalink
allow hyphenated words and words with zeroes (n00b)
Browse files Browse the repository at this point in the history
  • Loading branch information
soops committed Jul 1, 2015
1 parent bc6b187 commit 556e5d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sentimood.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class Sentimood
hits -= score
words.push t

noPunctuation = phrase.replace(/[^a-zA-Z ]+/g, ' ').replace('/ {2,}/', ' ')
noPunctuation = phrase.replace(/[^a-zA-Z -]+/g, ' ').replace('/ {2,}/',' ')
tokens = noPunctuation.toLowerCase().split " "
hits = 0
words = []
Expand All @@ -37,7 +37,7 @@ class Sentimood
hits += score
words.push t

noPunctuation = phrase.replace(/[^a-zA-Z ]+/g, ' ').replace('/ {2,}/', ' ')
noPunctuation = phrase.replace(/[^a-zA-Z -]+/g, ' ').replace('/ {2,}/',' ')
tokens = noPunctuation.toLowerCase().split " "
hits = 0
words = []
Expand Down

0 comments on commit 556e5d0

Please sign in to comment.