mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
Added list of Nodes to he ReadME so people can see what's there without digging... Bunch of cleanups to node-red-nodes... mainly just removing tabs -> spaces and stuff. No code changes...
This commit is contained in:
@@ -24,14 +24,14 @@
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="wordpos">
|
||||
<p>Analyses <b>msg.payload</b> and classifies the part-of-speech of each word.</p>
|
||||
<p>The resulting message has <b>msg.pos</b> added with the results:</p>
|
||||
<pre>{
|
||||
nouns:[],
|
||||
verbs:[],
|
||||
adjectives:[],
|
||||
adverbs:[],
|
||||
rest:[]
|
||||
<p>Analyses <b>msg.payload</b> and classifies the part-of-speech of each word.</p>
|
||||
<p>The resulting message has <b>msg.pos</b> added with the results:</p>
|
||||
<pre>{
|
||||
nouns:[],
|
||||
verbs:[],
|
||||
adjectives:[],
|
||||
adverbs:[],
|
||||
rest:[]
|
||||
}</pre>
|
||||
<p>Note: a word may appear in multiple POS (eg, 'great' is both a noun and an adjective)</p>
|
||||
</script>
|
||||
@@ -53,5 +53,4 @@
|
||||
return this.name?"node_label_italic":"";
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
@@ -15,20 +15,17 @@
|
||||
**/
|
||||
|
||||
var RED = require(process.env.NODE_RED_HOME+"/red/red");
|
||||
var util = require("util");
|
||||
var WordPos = require('wordpos');
|
||||
|
||||
var wordpos = new WordPos();
|
||||
|
||||
function WordPOSNode(n) {
|
||||
RED.nodes.createNode(this,n);
|
||||
this.on("input", function(msg) {
|
||||
var node = this;
|
||||
wordpos.getPOS(msg.payload, function (result) {
|
||||
msg.pos = result;
|
||||
node.send(msg);
|
||||
});
|
||||
var node = this;
|
||||
wordpos.getPOS(msg.payload, function (result) {
|
||||
msg.pos = result;
|
||||
node.send(msg);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
RED.nodes.registerType("wordpos",WordPOSNode);
|
||||
|
Reference in New Issue
Block a user