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

@nlpjs/lang-ko

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nlpjs/lang-ko - npm Package Compare versions

Comparing version 4.1.4 to 4.2.1

4

package.json
{
"name": "@nlpjs/lang-ko",
"version": "4.1.4",
"version": "4.2.1",
"description": "Core",

@@ -30,3 +30,3 @@ "author": {

},
"gitHead": "99500ae2f3e16666fa5cc08a486664ef5267e810"
"gitHead": "96ade95b2be5b659a2271d975ca8acdc5b2ed19e"
}

@@ -30,2 +30,3 @@ /*

const names = {};
let initialized = false;

@@ -63,8 +64,14 @@ function build() {

build();
buildNames();
function initDicts() {
if (!initialized) {
build();
buildNames();
initialized = true;
}
}
module.exports = {
initDicts,
dictionary,
names,
};

@@ -25,5 +25,6 @@ /*

const { decomposeHangul, codaMap, composeHangul } = require('./hangul');
const { names } = require('./korean-dictionary');
const { initDicts, names } = require('./korean-dictionary');
function isName(word) {
initDicts();
if (names.Full[word] || names.Given[word]) {

@@ -30,0 +31,0 @@ return true;

@@ -25,3 +25,3 @@ /*

const { chunk } = require('./korean-chunker');
const { dictionary } = require('./korean-dictionary');
const { initDicts, dictionary } = require('./korean-dictionary');

@@ -35,2 +35,3 @@ const {

function getTopSlice(word) {
initDicts();
const max = Math.min(word.length, 2);

@@ -87,2 +88,3 @@ for (let i = max; i > 1; i -= 1) {

function stemWord(token) {
initDicts();
const value = dictionary[token];

@@ -89,0 +91,0 @@ if (value) {

@@ -26,3 +26,3 @@ /*

const { tokenize, stemWord } = require('./korean-tokenizer');
const { dictionary } = require('./korean-dictionary');
const { initDicts, dictionary } = require('./korean-dictionary');
const TokenizerKo = require('./tokenizer-ko');

@@ -150,2 +150,3 @@ const NormalizerKo = require('./normalizer-ko');

innerStem() {
initDicts();
const word = this.getCurrent();

@@ -158,2 +159,3 @@ const token = stemWord(this.prestem(word.trim()));

async stem(text, input) {
initDicts();
const inputText =

@@ -191,2 +193,3 @@ typeof text === 'string' ? text : input.utterance || input.text;

tokenizeAndStem(text) {
initDicts();
const newText = this.tokenize(this.normalize(text)).join(' ');

@@ -193,0 +196,0 @@ const tokens = tokenize(this.normalize(newText))

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