I have a text file and I want to get numerical value related to all the different words in that file. Numeric value, I mean, I want to assign a unique integer value (at the time of attendance value) so that I can use that numerical data for text analysis.
Can someone suggest which function is used for it?
Please note, I originally wrote this thought that it was Javascript question). Hopefully this can be used by any Python-Javascript ninja ...
Assume that you already have all the text shown in the variable named filetext
is.
var word = fileText.replace (/. /, '') .split (''); Var verbatim = {}; (Var i = 0; i & lt; words.length; i ++) {var word = word [i]; If (! Word word [word]) word [word] = 0; WordsCount [word] ++; }
the password will be an object representing the number of times the number of times used for each object.
No comments:
Post a Comment