Asked — Edited

Javascript Plugin

I am sure the answer is no but have to ask.

Is it possible to add/install a JavaScript library within ARC?


ARC Pro

Upgrade to ARC Pro

Experience early access to the latest features and updates. You'll have everything that is needed to unleash your robot's potential.

PRO
USA
#2  

@DJ You are Awesome! I am now going to try and work with an NLP library to process and analyze speech. Thank you

#3  

Which NLP are you going to use? I'm being nosey.

PRO
Synthiam
#4  

ARC isn't a web browser, so i'm not sure how that will work.

PRO
USA
#5  

@DJ It works GREAT!

@Justin I am using Compromise. here is a link https://github.com/spencermountain/compromise

In the Builds folder, I am using the compromise.js


var doc = nlp('the quick brown fox jumped over the lazy dog')
 var str = doc.nouns().out('text')
var ccc = doc.match('#Adjective fox').out('text')
var vrb = doc.verbs().out('text')
var frstn = doc.nouns().first().out('text')
print(ccc)
print(vrb)
print(frstn)
print(str)

and the output of this is:


Started
 brown fox
 jumped
 fox
 fox dog
Done (took: 00:00:00.1420776)

PRO
USA
#6  

Don't judge the coding, Keep in mind I am just learning JavaScript.

PRO
USA
#8  

This should take my Simple Robot Brain to the next level. After I get a better handle on JavaScript.

PRO
USA
#10  

An example of what it can do:

The JavaScript


var doc = nlp(EZB.GetVar("$TheSentence"))
var pastTense = doc.sentences().toPastTense().out()
EZB.SetVar("$pastTense", pastTense)

The EZ-Script code


$TheSentence = "The dog will eat his food"
ControlCommand("Compromise",ScriptStartWait)
Print($pastTense)

The resulting output


Start
1: $TheSentence = "The dog will eat his food"
3: ControlCommand("Compromise",ScriptStartWait)
5: Print($pastTense)
> The dog ate his food
Done (00:00:00.2999611)

This is cool!