Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. The first line of code seems like it is wanting the rawString to return lower case however it also wants it to split the specific objects /
  2. that it's passed in the parens. it wants to filter falsy Booleans and then sort those items from a-z.
  3.  
  4. The next code is words being set to the function getTokens and passing text into it and is expected to execute the function on line 1. Word frequencies is
  5. empty because we want it to return something later. The for loop is saying that i is less than or equal to words.length and i will increase 1.
  6. Next it says if this partuclar word is found in words or the text multiple times add it to word frequencies everytime it occurs, if this word only is read once then it should
  7. only log once.
  8.  
  9. currentMaxKey is suppose to log each time the word appears in the text as a key.
  10. currentMaxCount count how many times that key appears in the text.
  11.  
  12. finally the for loop is if the wordfrequencies[word] is greater than the current maxcount then the current highest
  13. counted word will be changed to that word.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement