| 1 | var LinkGrammar = require(__dirname + "/../build/index"); |
| 2 | |
| 3 | // Load module |
| 4 | var linkGrammar = new LinkGrammar(); |
| 5 | |
| 6 | // Parse text into linkage object |
| 7 | // Of which you can query the links, words and link tree |
| 8 | var linkage = linkGrammar.parse('turn off the light'); |
| 9 | |
| 10 | // You can query links by label |
| 11 | var mvLinks = linkage.linksByLabel('MV'); |
| 12 | |
| 13 | // You can also get the word objects connected to a specific word in the text |
| 14 | // Each word object contains label and type informations about the connection |
| 15 | var connections = linkage.getConnectorWords('off'); |