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:
Dave C-J
2013-11-10 17:01:19 +00:00
parent 6425bd75cb
commit 793fd3c7fd
16 changed files with 340 additions and 375 deletions

View File

@@ -31,7 +31,7 @@
category: 'analysis-function',
color:"#E6E0F8",
defaults: {
name: {value:""},
name: {value:""}
},
inputs:1,
outputs:1,

View File

@@ -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>

View File

@@ -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);