Hello,
I have wordlist.txt which contains approx. 70000 words list…
How i can access and search specific word from worldlist.txt?
It would be great if anyone can help…
Thanks in advance…
Hello,
I have wordlist.txt which contains approx. 70000 words list…
How i can access and search specific word from worldlist.txt?
It would be great if anyone can help…
Thanks in advance…
contents.split("\n")[contents.split("\n").indexOf(myWord)]
—@Fus_ion Thank you very much for HELP!
I can understand it… I will do something about it…
Here i am posting sample code…
var WordListManagerScript = pc.createScript('wordListManagerScript');
WordListManagerScript.attributes.add('wordListText', {type: 'asset',assetType: 'text'});
// initialize code called once per entity
WordListManagerScript.prototype.initialize = function() {
console.log(this.wordListText);
console.log(this.wordListText._resources[0]);
var fileData = this.wordListText._resources[0];
var wordByIndexNumber = fileData.split("\n")[9339];
var indexNumberByWord = fileData.split("\n").indexOf("bus");
console.log(wordByIndexNumber); // Output - bus
console.log(indexNumberByWord); // Output - 9339
};
// update code called every frame
WordListManagerScript.prototype.update = function(dt) {
};
So attached wordlist
Works Great for me!
Thanks!