Socket
Socket
Sign inDemoInstall

pos

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pos - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

2

package.json

@@ -20,3 +20,3 @@ {

],
"version": "0.2.1",
"version": "0.2.2",
"licenses": [

@@ -23,0 +23,0 @@ {

@@ -20,16 +20,24 @@ ABOUT:

npm install pos
`$ npm install pos`
USAGE:
var pos = require('pos');
var words = new pos.Lexer().lex("This is some sample text. This text can contain multiple sentences.");
var taggedWords = new pos.Tagger().tag(words);
for (i in taggedWords) {
var taggedWord = taggedWords[i];
var word = taggedWord[0];
var tag = taggedWord[1];
console.log(word + " /" + tag);
}
```javascript
var pos = require('pos');
var words = new pos.Lexer().lex('This is some sample text. This text can contain multiple sentences.');
var tagger = new pos.Tagger();
var taggedWords = tagger.tag(words);
for (i in taggedWords) {
var taggedWord = taggedWords[i];
var word = taggedWord[0];
var tag = taggedWord[1];
console.log(word + " /" + tag);
}
// extend the lexicon
tagger.extendLexicon({'Obama': ['NNP']});
tagger.tag(['Mr', 'Obama']);
// --> [[ 'Mr', 'NNP' ], [ 'Obama', 'NNP' ]]
```
ACKNOWLEDGEMENTS:

@@ -36,0 +44,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc