npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nv-nlp-parse-stanza

v1.0.2

Published

nv-nlp-parse-stanza =============== - nv-nlp-parse-stanza - util for parse the rslt returned from stanza server (stanfordnlp) - nvlang has a chinese-DSL mode, this is for testing generate js-code from chinese-sentences in nvlang, normally USELESS - i

Downloads

1

Readme

nv-nlp-parse-stanza

  • nv-nlp-parse-stanza
  • util for parse the rslt returned from stanza server (stanfordnlp)
  • nvlang has a chinese-DSL mode, this is for testing generate js-code from chinese-sentences in nvlang, normally USELESS
  • in the chinese-DSL mode ,customer will input a chinese-sentence, after handled by stanza, stanza will return the constituency(its s-expression)
  • nvlang will based on the shapes to find a matched function-shape

install

  • npm install nv-nlp-parse-stanza

usage

     const {parse} = require("nv-nlp-parse-stanza");

example

        var d =   {
            text: '所以我们自然就想到了 Python 中的异步框架',
            sentiment: null,
            words: [
              {
                id: 1,
                text: '所以',
                upos: 'ADV',
                xpos: 'RB',
                start_char: 0,
                end_char: 2
              },
              {
                id: 2,
                text: '我们',
                upos: 'PRON',
                xpos: 'PRP',
                feats: 'Number=Plur|Person=1',
                start_char: 2,
                end_char: 4
              },
              {
                id: 3,
                text: '自然',
                upos: 'ADV',
                xpos: 'RB',
                start_char: 4,
                end_char: 6
              },
              {
                id: 4,
                text: '就',
                upos: 'ADV',
                xpos: 'RB',
                start_char: 6,
                end_char: 7
              },
              {
                id: 5,
                text: '想到',
                upos: 'VERB',
                xpos: 'VV',
                start_char: 7,
                end_char: 9
              },
              {
                id: 6,
                text: '了',
                upos: 'AUX',
                xpos: 'AS',
                feats: 'Aspect=Perf',
                start_char: 9,
                end_char: 10
              },
              {
                id: 7,
                text: 'Python',
                upos: 'X',
                xpos: 'FW',
                start_char: 11,
                end_char: 17
              },
              {
                id: 8,
                text: '中',
                upos: 'ADP',
                xpos: 'IN',
                start_char: 18,
                end_char: 19
              },
              {
                id: 9,
                text: '的',
                upos: 'PART',
                xpos: 'DEC',
                feats: 'Case=Gen',
                start_char: 19,
                end_char: 20
              },
              {
                id: 10,
                text: '异步',
                upos: 'ADJ',
                xpos: 'JJ',
                start_char: 20,
                end_char: 22
              },
              {
                id: 11,
                text: '框架',
                upos: 'NOUN',
                xpos: 'NN',
                start_char: 22,
                end_char: 24
              }
            ],
            entities: [],
            constituency: {
              cnt: 36,
              structure: [
                'ROOT',
                [
                  [
                    'IP',
                    [
                      [
                        'ADVP',
                        [
                          [ 'RB', [ [ '所以', [] ] ] ]
                        ]
                      ],
                      [
                        'NP',
                        [
                          [ 'PRP', [ [ '我们', [] ] ] ]
                        ]
                      ],
                      [
                        'VP',
                        [
                          [
                            'ADVP',
                            [
                              [ 'RB', [ [ '自然', [] ] ] ]
                            ]
                          ],
                          [
                            'ADVP',
                            [
                              [ 'RB', [ [ '就', [] ] ] ]
                            ]
                          ],
                          [
                            'VP',
                            [
                              [ 'VV', [ [ '想到', [] ] ] ],
                              [ 'AS', [ [ '了', [] ] ] ],
                              [
                                'NP',
                                [
                                  [
                                    'DNP',
                                    [
                                      [
                                        'LCP',
                                        [
                                          [
                                            'NP',
                                            [
                                              [ 'FW', [ [ 'Python', [] ] ] ]
                                            ]
                                          ],
                                          [ 'IN', [ [ '中', [] ] ] ]
                                        ]
                                      ],
                                      [ 'DEC', [ [ '的', [] ] ] ]
                                    ]
                                  ],
                                  [
                                    'ADJP',
                                    [
                                      [ 'JJ', [ [ '异步', [] ] ] ]
                                    ]
                                  ],
                                  [
                                    'NP',
                                    [
                                      [ 'NN', [ [ '框架', [] ] ] ]
                                    ]
                                  ]
                                ]
                              ]
                            ]
                          ]
                        ]
                      ]
                    ]
                  ]
                ]
              ]
            }
          }



        r = parse(d)
        /*
        {
          text: '所以我们自然就想到了 Python 中的异步框架',
          sentiment: null,
          words: [
            { text: '所以', upos: 'ADV', xpos: 'RB', feats: null },
            {
              text: '我们',
              upos: 'PRON',
              xpos: 'PRP',
              feats: 'Number=Plur|Person=1'
            },
            { text: '自然', upos: 'ADV', xpos: 'RB', feats: null },
            { text: '就', upos: 'ADV', xpos: 'RB', feats: null },
            { text: '想到', upos: 'VERB', xpos: 'VV', feats: null },
            { text: '了', upos: 'AUX', xpos: 'AS', feats: 'Aspect=Perf' },
            { text: 'Python', upos: 'X', xpos: 'FW', feats: null },
            { text: '中', upos: 'ADP', xpos: 'IN', feats: null },
            { text: '的', upos: 'PART', xpos: 'DEC', feats: 'Case=Gen' },
            { text: '异步', upos: 'ADJ', xpos: 'JJ', feats: null },
            { text: '框架', upos: 'NOUN', xpos: 'NN', feats: null }
          ],
          entities: [],
          constituency: {
            brief: { texts: [Array], tblocs: [Array], shapes: [Array] },
            detail: { texts: [Array], tblocs: [Array], shapes: [Array] }
          }
        }
        >
        */

        /*
        > r.constituency.brief
        {
          texts: [
            '所以我们自然就想到了Python中的异步框架',
            '所以',
            '我们',
            '自然就想到了Python中的异步框架',
            '自然',
            '就',
            '想到了Python中的异步框架',
            '想到',
            '了',
            'Python中的异步框架',
            'Python中的',
            'Python中',
            'Python',
            '中',
            '的',
            '异步',
            '框架'
          ],
          tblocs: [
            '(((所以))((我们))(((自然))((就))((想到)(了)(((((Python))(中))(的))((异步))((框架))))))',
            '((所以))',
            '((我们))',
            '(((自然))((就))((想到)(了)(((((Python))(中))(的))((异步))((框架)))))',
            '((自然))',
            '((就))',
            '((想到)(了)(((((Python))(中))(的))((异步))((框架))))',
            '(想到)',
            '(了)',
            '(((((Python))(中))(的))((异步))((框架)))',
            '((((Python))(中))(的))',
            '(((Python))(中))',
            '((Python))',
            '(中)',
            '(的)',
            '((异步))',
            '((框架))'
          ],
          shapes: [
            'IP(ADVP(RB())NP(PRP())VP(ADVP(RB())ADVP(RB())VP(VV()AS()NP(DNP(LCP(NP(FW())IN())DEC())ADJP(JJ())NP(NN())))))',
            'ADVP(RB())',
            'NP(PRP())',
            'VP(ADVP(RB())ADVP(RB())VP(VV()AS()NP(DNP(LCP(NP(FW())IN())DEC())ADJP(JJ())NP(NN()))))',
            'ADVP(RB())',
            'ADVP(RB())',
            'VP(VV()AS()NP(DNP(LCP(NP(FW())IN())DEC())ADJP(JJ())NP(NN())))',
            'VV()',
            'AS()',
            'NP(DNP(LCP(NP(FW())IN())DEC())ADJP(JJ())NP(NN()))',
            'DNP(LCP(NP(FW())IN())DEC())',
            'LCP(NP(FW())IN())',
            'NP(FW())',
            'IN()',
            'DEC()',
            'ADJP(JJ())',
            'NP(NN())'
          ]
        }
        >
        */

METHODS

API

    {
        parse_words,
        parse_constituency,
        parse
    }

LICENSE

  • ISC