Skip to content

aattola/voikko-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Voikko library for JavaScript with TypeScript type definitions

Compiled from libvoikko-js libvoikko with emscripten. Single file build with Finnish language dictionary Joukahainen included. Currently only morpho dictionary is included.

Libvoikko is licensed under GPL3, https://github.com/voikko/corevoikko/blob/master/LICENSE

Installation

Install from npm:

npm install voikko

Usage

Read autogenerated docs

Example:

import BaseVoikko from "voikko";
let voikko = BaseVoikko().init("fi");

console.log(voikko.analyze("Kangasalla"));
// =>
// [
//   {
//     BASEFORM: 'Kangasala',
//     CLASS: 'paikannimi',
//     FSTOUTPUT: '[Lep][Xp]Kangasala[X]kangas[Bm]a[Sade][Ny]lla',
//     NUMBER: 'singular',
//     SIJAMUOTO: 'ulkoolento',
//     STRUCTURE: '=ippppp=pppp',
//     WORDBASES: '+Kangasala(Kangasala)'
//   }
// ]

console.log(voikko.analyze("Tampereella"));
// =>
// [
//   {
//     BASEFORM: 'Tampere',
//     CLASS: 'paikannimi',
//     FSTOUTPUT: '[Lep][Ipu][Xp]Tampere[X]tamperee[Sade][Ny]lla',
//     NUMBER: 'singular',
//     SIJAMUOTO: 'ulkoolento',
//     STRUCTURE: '=ipppppppppp',
//     WORDBASES: '+Tampere(Tampere)'
//   }
// ]

Build yourself with apple silicon:

npm run build

or just copy the build command from package.json

docker build --output ./build -t voikko ./docker

About

JS/TS Library of libvoikko

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published