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

parse-japanese-basic

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-japanese-basic

Japanese (natural language) parser basic module

  • 0.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

parse-japanese-basic js-standard-style

A Japanese language parser producing NLCST nodes. This module is a basic module for retext-japanese.

  • For semantics of nodes, see NLCST;

Installation

npm:

npm install parse-japanese-basic

Usage

var inspect = require('unist-util-inspect')

var ParseJapaneseBasic = require('parse-japanese-basic')
var japanese = new ParseJapaneseBasic()

var text = 'タイトル\n' +
             '\n' +
             '1 これは前段です。これは中段(2文の場合は後段。)です。これは後段です。\n'
             
var cst = japanese.parse(text)

console.log(inspect(cst))

/**
* RootNode[3] (1:1-3:39, 0-44)
* ├─ ParagraphNode[2] (1:1-1:6, 0-5)
* │  ├─ TextNode: "タイトル" (1:1-1:5, 0-4)
* │  └─ WhiteSpaceNode: "\n" (1:5-1:6, 4-5)
* ├─ ParagraphNode[1] (2:1-2:2, 5-6)
* │  └─ WhiteSpaceNode: "\n" (2:1-2:2, 5-6)
* └─ ParagraphNode[2] (3:1-3:39, 6-44)
*    ├─ TextNode: "1 これは前段です。これは中段(2文の場合は後段。)です。これは後段です。" (3:1-3:38, 6-43)
*    └─ WhiteSpaceNode: "\n" (3:38-3:39, 43-44)
*/

API

ParseJapaneseBasic(options?)

Exposes the functionality needed to tokenize natural Japanese languages into a syntax tree.

Parameters:

  • options (Object, optional)

    • position (boolean, default: true) - Whether to add positional information to nodes.

ParseJapaneseBasic#parse(value)

Tokenize natural Japanese languages into an NLCST syntax tree.

Parameters:

  • value (VFile or string) — Text document;

License

MIT

Keywords

FAQs

Package last updated on 10 Oct 2015

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