Helper functions on an included database derived from Lefff

Usage no npm install needed!

<script type="module">
  import lefffHelper from 'https://cdn.skypack.dev/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.


npm install lefff-helper


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.


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.