Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

en-parse

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

en-parse

English language syntactic dependency parser

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32
decreased by-3.03%
Maintainers
1
Weekly downloads
 
Created
Source

English Parse

English language syntactic dependency parser.

important This project is in a very early stage, it's rather an experiment than a real a project. Using it in production may hurt your feelings.

Installation and Usage

npm i --save en-parse
const parser = require("en-parse").default;
let parsed = parser(["PRP","VBP","TO","VBP"],["i","like","to","parse"]);

NOTE: tokens should be normalized (contractions, abbreviations and such all resolved to it's normal form).

The parsed variable is now an array like this one:

[
  {
    "label": "MWE",
    "type": "NP",
    "master": 1
  },
  {
    "label": "NSUBJ",
    "type": "NP",
    "master": 2
  },
  {
    "label": "ROOT",
    "type": "VP",
    "master": -1
  },
  {
    "label": "COMPMARK",
    "type": "PP",
    "master": 5
  },
  {
    "label": "NSUBJ",
    "type": "NP",
    "master": 5
  },
  {
    "label": "XCOMP",
    "type": "VP",
    "master": 2
  },
  {
    "label": "ADVMOD",
    "type": "ADV",
    "master": 8
  },
  {
    "label": "AUX",
    "type": "VBN",
    "master": 8
  },
  {
    "label": "ADVCL",
    "type": "VP",
    "master": 5
  },
  {
    "label": "PUNCT",
    "type": "PUNCT",
    "master": 2
  }
]

Annotation Specs:

Core Nominal Arguments

AnnotationNameExample
NSUBJNominal SubjectI like you
DOBJDirect ObjectI like you
IOBJIndirect Objectshe gave me a book
NSUBJPASSNominal Subject (passive)I have been given a chance
CCOMPClausal ComplementThe boss ordered to dig the hole
XCOMPOpen Clausal ComplementThe boss told us to dig
OBLOblique ObjectGive the toys to the children
EXPLExpletiveI have been there
ADVCLAdverb Clause ModifierWe were walking as the rain was falling
ADVMODAdverbial modifierI don't eat genetically modified food.
DISCOURSEDiscourseI like that :)
VPRTVerbal ParticleI switched the TV off
AUXAuxiliaryI am going to buy a new computer
AUXPASSAuxiliary (passive)I have been marked
COMPMARKComplement MarkerI will do it if I like it
ADVMARKAdverb MarkerI did it after I was convinced
NOMDNominal ModifierMSNBC news had little effect on the market
NUMMODNumeric ModifierI ate 2 eggs this morning
ACLClausal Modifier of a NounI saw the man you love
AMODAdjectival Modifieryou were good to him
DETDeterminerwhich book you prefer?
CASECase MarkingI went to Rachel
PUNCTPunctuationGuys, keep calm!
CCCoordinating ConjunctionMathew and Alex
INTERJInterjectionPass me the sugar, please
EXTExtensionMy name is Alex Corvi
DEPUnrecognized dependencyhow what

Why?

  • Current solutions uses statistical machine learning models which makes it 5 times slower (if not worse) than a rule based implementation like this one.
  • This is a javascript implementation, so it can be used for an in-browser natural language processing.
  • Also because it's written in javascript it might be preferred in smart bots to reduce the complexity of having your bot written in node.js and the natural language processor written in Python or C++.

Credits

The idea of this parser was originally featured as a small experiment in Xav Ulflander's Compendium.

Keywords

FAQs

Package last updated on 08 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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