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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yongsk0066/mce

v0.3.4

Published

Finnish NLP engine — morphological analysis, spell checking, POS tagging, hyphenation, grammar checking. Browser-first, offline-capable, ~395KB WASM.

Readme

mce-wasm

WebAssembly bindings for the MCE Finnish NLP engine. Exposes 22 API methods via wasm-bindgen for complete offline Finnish language processing in the browser.

Features

  • ~395KB WASM binary, <5ms/sentence latency
  • Morphological analysis, spell checking, grammar checking, hyphenation
  • Sentence-level POS disambiguation (Viterbi + CG + optional suffix tagger)
  • Compound word splitting, spelling suggestions, morphological generation
  • Fully offline -- no server dependency

API (22 methods)

| Method | Description | |--------|-------------| | load(dict) | Create engine from VFST dictionary bytes | | load_model(data) | Load suffix tagger model (boosts UPOS 82.71% -> 94.58%) | | has_model() | Check if suffix tagger model is loaded | | load_wordlist(data) | Load wordlist for trie-based spelling suggestions | | has_wordlist() | Check if wordlist (suggestion trie) is loaded | | analyze(word) | Single-word morphological analysis (JSON) | | spell_check(word) | Check if word is correctly spelled (morph analysis + compound-aware) | | suggest(word, max) | Spelling suggestions for misspelled words | | suggest_with_context(word, prev, max) | Context-aware suggestions ranked by POS bigram | | analyze_sentence(text) | Sentence analysis with disambiguation (JSON) | | disambiguate_sentence(text) | POS disambiguation with full attributes (JSON) | | compound_split(word) | Compound word splitting with penalties | | grammar_check(text) | Grammar error detection with byte offsets | | hyphenate(word) | Single-word Finnish hyphenation | | hyphenate_text(text) | Full-text hyphenation preserving non-word tokens | | get_baseform(word) | Lemma lookup (disambiguated) | | is_valid_word(word) | Pure morphological analysis check (boolean) | | generate_form(base, case, number) | Generate noun case form (singular or plural) | | generate_paradigm(base) | Full noun paradigm (22 forms: 11 singular + 11 plural) | | generate_verb_form(...) | Generate verb conjugation (beta) | | generate_verb_paradigm(inf) | Full verb paradigm (beta) | | version() | Engine version string |

Usage

import init, { MceEngine } from './mce_wasm.js';

await init();

// Load dictionary (required)
const dict = await fetch('mor.vfst').then(r => r.arrayBuffer());
const engine = MceEngine.load(new Uint8Array(dict));

// Optional: load suffix tagger for higher accuracy
const model = await fetch('suffix_tagger.bin').then(r => r.arrayBuffer());
engine.load_model(new Uint8Array(model));
console.log(engine.has_model()); // true

// Morphological analysis
engine.analyze("koira");
// [{"CLASS":"nimisana","BASEFORM":"koira","STRUCTURE":"=ppppp",...}]

// Spell checking
engine.spell_check("koira");    // true
engine.spell_check("koirra");   // false

// Sentence-level analysis with disambiguation
engine.analyze_sentence("Koira juoksee nopeasti");
// [{"word":"Koira","analysis":{"CLASS":"nimisana","BASEFORM":"koira"}},
//  {"word":"juoksee","analysis":{"CLASS":"teonsana","BASEFORM":"juosta"}}]

// Grammar checking (byte offsets for editor integration)
engine.grammar_check("koira koira juoksee.");
// [{"start":6,"end":11,"code":"REPEATED_WORD","message":"Repeated word: koira","suggestions":["koira"]}]

// Compound word splitting
engine.compound_split("rautatieasema");
// [{"parts":[{"surface":"rauta",...},{"surface":"tie",...},{"surface":"asema",...}],"penalty":30}]

// Hyphenation
engine.hyphenate("suomalainen");              // "suo-ma-lai-nen"
engine.hyphenate_text("Koira juoksee.");      // "Koi-ra juok-see."

// Lemma lookup
engine.get_baseform("koirien");               // "koira"

// Morphological generation
engine.generate_paradigm("koira");            // Full 22-form paradigm JSON (11 sg + 11 pl)
engine.generate_verb_paradigm("juosta");      // Full verb conjugation JSON

Build

# Install wasm-pack
cargo install wasm-pack

# Build WASM package
wasm-pack build crates/mce-wasm --target web --release

# Output: pkg/mce_wasm.js, pkg/mce_wasm_bg.wasm (~395KB)

Dependencies

Uses: mce-core, mce-fst, mce-fi, mce-disambig, mce-comonad, mce-tokenizer, mce-grammar, wasm-bindgen, js-sys, serde, serde-wasm-bindgen

Used by: JavaScript/browser consumers