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
getAdjtakes a flex form (string) of an adjective and returns its root. bel => beau.
nullwhen 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é).
getNountakes a flex form (string) of a noun and returns its root. yeux => oeil.
nullwhen 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.