Socket
Book a DemoInstallSign in
Socket

goya-core

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

goya-core

WebAssembly binding of Goya

0.1.9
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Getting started

分かち書き

goya-core を import して parse 関数を使用します。parse メソッドの戻り値から各種メソッドを呼べるようにしています。 分かち書きをするならwakachiメソッドを使用します。

import core from "goya-core";

const lattice = core.parse("すもももももももものうち");
lattice.wakachi(); // => ["すもも", "も", "もも", "も", "もも", "の", "うち"]

形態素解析

形態素解析の結果を得るにはfind_bestメソッドを使用します。find_best は形態素の配列を返します。各形態素はこれらのフィールドを持っています。サイズ削減のためこのオブジェクトは品詞や読み仮名などの素性を持っていません。

  • wid: 語彙 ID。goya-features で使用 (後述)
  • is_known: 既知後なら true、未知語なら false
  • surface_form: 表層体
lattice.find_best()[0].surface_form; // => "すもも"
lattice.find_best()[0].is_known; // => true
lattice.find_best()[0].wid; // => 次項で説明

FAQs

Package last updated on 24 Oct 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.