
Show HN: Grumbles.js – Detects when your users swear out loud - kpthunder
http://knpw.rs/grumbles.js/
======
zschuessler
Fun fact: this won't tell you which bad word. Google's implementation of the
speech API returns asterisks for words it deems bad. See:

[https://github.com/knpwrs/grumbles.js/blob/master/src/grumbl...](https://github.com/knpwrs/grumbles.js/blob/master/src/grumbles.js)

It's also interesting to see which words Google determines is bad, and which
they mysteriously don't. The API does real time processing of sentence
structure and will return "<three asterisks> on me" and "cum to the park"
correctly, based on intent. (Sorry for the offensive speech!)

For a side project I needed to find every single English word/phrase the API
would filter. Stumbled upon that in amazement.

(Side note: speaking a long list of bad words into a microphone very slowly
was the most fun QA I've done)

~~~
harperlee
I get that this is a free service and all, but I find that ridiculous. They
are basically crippling the functionality of a service that is global and it
is not aimed at a particular application, based on a very localized
interpretation of what is nice to say and what is not... this should be
controlled at the application level, the API providing at most hints about the
tone.

Depending on what you use it on, this could render the service useless.
Imagine using it to, I don't know, trying to identify Pulp Fiction sentences
against a corpus of scripts. It would fail spectacularly.

Another example context on where this could fail very quickly is when
considering people from other languages, e.g., if I'm not wrong, saying
"Jesus!" might be impolite in (some contexts of) the US. In Spain, we say
"Jesus!" when you sneeze, instead of "Bless you!" (and, in general, we are
outrageously foul-mouthed compared to the US).

~~~
harperlee
By the way, I can't edit my comment any longer, but when I said:

> In Spain, we say "Jesus!" when you sneeze, instead of "Bless you!" (and, in
> general, we are outrageously foul-mouthed compared to the US).

..it may sound as if "¡Jesús!" ("Bless you!") is foulmouthed - when in fact is
something a four-year-old would typically say.

------
justinlardinois
Ignoring the unlikelihood of someone actually authorizing microphone
permissions (because it's no fun if we take that into consideration), what are
some good use cases for this library.

Reminds me of those rumors that swearing at an automated phone system will
usually cause it to direct you to a human operator. I've never given it a try
myself to see if it's true.

~~~
kpthunder
A code review app can measure WTFs / minute, as in the classic web comic:
[http://imgur.com/a/BHlkA](http://imgur.com/a/BHlkA)

------
EdSharkey
"Your browser does not support the SpeechRecognition API. :("

HURRAY! And, it never shall.

------
templaedhel
I think the most interesting part of this for me is the fact it relies on the
the SpeechRecognition api to return swear words redacted with asterisks.

See for example George Carlin's "Seven dirty words" as returned by the
SpeechRecognition demo
[https://cl.ly/3A1F0r3U1H1D/Screen%20Shot%202016-09-03%20at%2...](https://cl.ly/3A1F0r3U1H1D/Screen%20Shot%202016-09-03%20at%204.49.14%20PM.png)

~~~
besselheim
Agreed, it's neat to see an anti-feature being subverted such that it becomes
a feature.

(The anti-feature being the enforcement of American prudity onto what should
be an indifferent API.)

------
booleandilemma
You are fined one credit for a violation of the Verbal Morality Statute.

------
cyberferret
Nifty idea - but I couldn't trigger it. Must be because it detected my sweet
choir boy nature, and knew that my attempts at profanity was 'cute' rather
than grumpy!

------
chowes
Tinfoil hat aside, I kinda like this.

We work with a decent number of older, non technical people, and our product
team would love to be a fly on the wall to hear where they're frustrated in
the product. Obviously due to security concerns we could never implement
something like this, but in a perfect world this would be a killer feature.

------
sverige
What the fuck is this shit doing on HN?

(Just kidding, for those who can't detect sarcasm. That's a killer idea -
build an app that detects sarcasm in text, deploy on HN, have a happier
community.)

~~~
trothamel
IBM's Watson doesn't detect sarcasm, but it does detect anger in your post.

[https://tone-analyzer-demo.mybluemix.net/](https://tone-analyzer-
demo.mybluemix.net/)

------
taneq
Wow, because I really want to have my computer listening in on everything I
say and snitching (with context) to an unknown listener if I say a bad word.

Cool tech. Uncool use.

------
Dwolk
because that's not creepy.

------
jamshid
It works but Chrome's Web Speech api seems slow. Test at
[https://www.google.com/intl/en/chrome/demos/speech.html](https://www.google.com/intl/en/chrome/demos/speech.html).
The Web Speech api doesn't work on mobile browsers, would be a lot cooler if
it did.

------
gcr
I don't like the idea of streaming every visitor's audio to Google servers as
they're viewing the site.

~~~
Klathmon
The Speech Recognition API doesn't go to anyone's servers, it's entirely done
in the browser, and is fully available offline as well.

~~~
atesti
Is it open sourced? Can it be used on Linux?

Any links are appreciated

------
djrogers
Ok, I know this is pedantic, but grumbling is not shouting swear words - in
fact it's the opposite of shouting.

------
mrspeaker
Ha ha, funny idea! After examining my own behaviour the other day I realised
that if I ever owned a store that faced the street, I would totally put a
microphone in the window to get customer feedback from after-hours window-
shoppers: you can't solicit that kind of honesty!

~~~
joeframbach
At the grocery store the other day, my wife and I were deciding between a few
items. The thought occurred to me that a microphone in the aisle would be huge
for customer feedback! A few seconds later I realized that it would just be a
feed of people yelling at their kids/spouses... not very helpful.

------
vorotato
Neat idea but the piece of shit ;) couldn't detect me calling it one.

~~~
kpthunder
Worked for me: [http://imgur.com/a/43Ksu](http://imgur.com/a/43Ksu)

------
andrewclunn
Geeze Louis! What the heck? Gosh darn it!

Is there a southern grandma setting?

------
jjallen
FYI, only single words worked: fu## and sh##. Didn't print out entire phrases,
even when I simplified the swear words (stemmed them).

------
diegorbaquero
Although the demo takes some time this is awesome! Thanks for sharing

------
nerdponx
Does this mean that Chrome is always listening on my computer's internal
microphone?

~~~
d0vs
You have to allow it first on a per-website basis

~~~
kpthunder
You actually have to allow it per-website per-visit (not even per-session).

~~~
Klathmon
no, it's per domain.

You only need to per-visit when it's an insecure localhost endpoint or
something similar IIRC. (or if you have an extension which clears that setting
every page load)

