This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function termFreqMap(str) { | |
| var words = str.split(' '); | |
| var termFreq = {}; | |
| words.forEach(function(w) { | |
| termFreq[w] = (termFreq[w] || 0) + 1; | |
| }); | |
| return termFreq; | |
| } | |
| function addKeysToDict(map, dict) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Environment = { | |
| isAndroid : function() { | |
| return navigator.userAgent.match(/Android/i); | |
| }, | |
| isBlackBerry : function() { | |
| return navigator.userAgent.match(/BlackBerry/i); | |
| }, | |
| isIOS : function() { | |
| return navigator.userAgent.match(/iPhone|iPad|iPod/i); |