lefff-helper
TypeScript icon, indicating that this package has built-in type declarations

5.3.0 • Public • Published

lefff-helper

The Lefff (Lexique des Formes Fléchies du Français) is a large-scale morphological and syntactic lexicon for French, distributed under the free LGPL-LR licence (Lesser General Public License For Linguistic Resources).

lefff-helper very simple Node.js module that contains:

  • json files derived from Lefff
  • a helper class to get data from these json files

The derived json files remains under LGPLLR.

Installation

npm install lefff-helper

Usage

var LefffHelper = require('lefff-helper').LefffHelper;

var lh = new LefffHelper();

// oeil
console.log( lh.getNoun("yeux") );

// beau
console.log( lh.getAdj("bel") );

The json files are created from the Lefff via the createDb script.

Current helpers:

  • getAdj takes a flex form (string) of an adjective and returns its root. bel => beau. null when not found. When the adjective is a past participle like embarrassée, the returned root is not the real lemma of the leff (would be embarrasser) but the masculine singular form (here embarrassé).
  • getNoun takes a flex form (string) of a noun and returns its root. yeux => oeil. null when not found.

Todo

Manage exceptions, as the Lefff often contain many roots for one plural, like:

chevaux	nc	cheval	mp
chevaux	nc	chevau	mp
chevaux	nc	chevaux	mp

The best choice is cheval / chevaux, but there is no clear information in the Lefff about the most frequent alternative.

dependencies and licences

Derived json files content under LGPLLR.

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i lefff-helper

    Weekly Downloads

    236

    Version

    5.3.0

    License

    Apache-2.0

    Unpacked Size

    4.29 MB

    Total Files

    13

    Last publish

    Collaborators

    • ludan.stoeckle